Skip to content

Commit

Permalink
Update run.sh
Browse files Browse the repository at this point in the history
Update to provide some more reliability on server boot time
  • Loading branch information
theonlydoo committed May 11, 2016
1 parent da071cb commit 56a40ec
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 56a40ec

Please sign in to comment.