deploy: add restart indicator to status
This commit is contained in:
parent
36c9340c41
commit
fc92831dcf
@ -1,36 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
. ./common.sh
|
||||
|
||||
while getopts "r" arg; do
|
||||
case $arg in
|
||||
r)
|
||||
REBOOT=1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
start
|
||||
|
||||
for i in $(ls hosts); do
|
||||
host=$(resolveAlias $i)
|
||||
echo -n "===> $i: "
|
||||
if tsAlive $host; then
|
||||
if ${SSH} root@$host 'check-restart' >/dev/null 2>&1; then
|
||||
echo -e "\tOK"
|
||||
else
|
||||
if [ ! -z $REBOOT ]; then
|
||||
if isRunHost $i; then
|
||||
echo -e "\tskipping runhost..."
|
||||
else
|
||||
echo -e "\trebooting..."
|
||||
${SSH} root@$host 'reboot' >/dev/null 2>&1
|
||||
fi
|
||||
else
|
||||
echo -e "\tREBOOT"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo -e "\tDOWN"
|
||||
fi
|
||||
done
|
7
deploy
7
deploy
@ -52,7 +52,12 @@ if [ "$1" = "status" ]; then
|
||||
rev_status="×"
|
||||
fi
|
||||
fi
|
||||
echo -e "\t\t${remote_ver}\t${rev_status}\t(${rev_msg})"
|
||||
echo -en "\t\t${remote_ver}\t${rev_status}\t(${rev_msg})"
|
||||
if ${SSH} root@$host 'check-restart' >/dev/null 2>&1; then
|
||||
echo -e "\tOK"
|
||||
else
|
||||
echo -e "\tREBOOT"
|
||||
fi
|
||||
done
|
||||
exit 0
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user