tpotce/installer/bin/status.sh

49 lines
1.2 KiB
Bash
Raw Normal View History

2015-01-27 16:46:52 +00:00
#!/bin/bash
########################################################
2015-12-08 14:47:39 +00:00
# T-Pot #
2015-01-27 16:46:52 +00:00
# Container and services status script #
# #
# v0.05 by mo, DTAG, 2016-02-12 #
2015-01-27 16:46:52 +00:00
########################################################
myCOUNT=1
if [[ $1 == "" ]]
then
myIMAGES=$(cat /data/images.conf)
else myIMAGES=$1
fi
2015-01-27 16:46:52 +00:00
while true
2015-08-07 21:45:50 +00:00
do
2015-01-30 20:40:01 +00:00
if ! [ -a /var/run/check.lock ];
2015-01-27 16:46:52 +00:00
then break
fi
sleep 0.1
if [ $myCOUNT = 1 ];
then
echo -n "Waiting for services "
else echo -n .
fi
2015-01-28 16:08:34 +00:00
if [ $myCOUNT = 300 ];
then
echo
echo "Services are busy or not available. Please retry later."
exit 1
fi
2015-01-27 16:46:52 +00:00
myCOUNT=$[$myCOUNT +1]
done
echo
echo
2015-12-08 14:47:39 +00:00
echo "======| System |======"
echo Date:" "$(date)
echo Uptime:" "$(uptime)
echo CPU temp: $(sensors | grep "Physical" | awk '{ print $4 }')
2015-01-27 16:46:52 +00:00
echo
2015-01-28 16:08:34 +00:00
for i in $myIMAGES
2015-08-07 21:45:50 +00:00
do
2015-01-27 16:46:52 +00:00
echo "======| Container:" $i "|======"
2015-06-12 09:35:59 +00:00
docker exec $i supervisorctl status | GREP_COLORS='mt=01;32' egrep --color=always "(RUNNING)|$" | GREP_COLORS='mt=01;31' egrep --color=always "(STOPPED|FATAL)|$"
2015-01-27 16:46:52 +00:00
echo
done