deploy: add restart indicator to status

This commit is contained in:
Aaron Bieber 2022-09-14 06:50:22 -06:00
parent 36c9340c41
commit fc92831dcf
No known key found for this signature in database
2 changed files with 6 additions and 37 deletions

View File

@ -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
View File

@ -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