Skip to content

Commit

Permalink
Merge pull request #56 from theonlydoo/patch-1
Browse files Browse the repository at this point in the history
Update run.sh
  • Loading branch information
kotakanbe committed May 20, 2016
2 parents 6af811d + 56a40ec commit 53e4adf
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions docker/run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
#!/bin/bash
go-cve-dictionary server &
sleep 2
vuls scan -config /app/config.toml -report-slack
tries=0

function isopen {
tries=$1
nmap -Pn -T4 -p 1323 127.0.0.1|grep -iq open
if [ $? -ne 0 ]; then
if [ $tries -lt 5 ]; then
let tries++
startserver $tries
else
return 1
fi
else
return 0
fi
}
function startserver {
tries=$1
go-cve-dictionary server &
sleep 2
isopen $tries
}

startserver $tries
if [ $? -ne 1 ]; then
vuls scan -config /app/config.toml -report-slack
fi

0 comments on commit 53e4adf

Please sign in to comment.