Permalink
Browse files

'if/else' was shortened

  • Loading branch information...
PeterPawn committed Aug 14, 2017
1 parent 510632b commit a3dd18d576b3a552113276713afe31849d9a0cda
Showing with 3 additions and 11 deletions.
  1. +1 −5 tools/waitconnected
  2. +2 −6 tools/waittimeset
View
@@ -1,9 +1,5 @@
#! /bin/sh
if [ -z $1 ]; then
loop=-1
else
loop=$(( $1 + 0 ))
fi
[ -z $1 ] && loop=-1 || loop=$(( $1 + 0 ))
while ! [ $(ctlmgr_ctl r connection0 status/connect) = "5" ]; do
loop=$(( loop + 1 ))
[ $loop -eq 0 ] && exit 1
View
@@ -1,9 +1,5 @@
#! /bin/sh
if [ -z "$1" ]; then
timeout=0
else
timeout=$(( $1 + 0 ))
fi
[ -z "$1" ] && timeout=0 || timeout=$(( $1 + 0 ))
starttime=$(date +%s)
[ $starttime -gt 86400 ] && exit $rc
difftime=$(( starttime + timeout ))
@@ -16,4 +12,4 @@ while [ $(date +%s) -lt $difftime ]; do
fi
sleep 1
done
exit 0
exit 0

0 comments on commit a3dd18d

Please sign in to comment.