scripts, configs, optimizations, dashboard base

This commit is contained in:
Marco Ochse
2016-02-12 22:47:19 +01:00
parent 792142a6f1
commit 2dc676868d
59 changed files with 163 additions and 59 deletions

View File

@ -4,7 +4,7 @@
# T-Pot #
# Container and services restart script #
# #
# v0.03 by mo, DTAG, 2015-11-02 #
# v0.04 by mo, DTAG, 2016-02-12 #
########################################################
myCOUNT=1
@ -21,9 +21,9 @@ do
fi
if [ "$myCOUNT" = "6000" ];
then
echo
echo "Overriding check.lock"
rm /var/run/check.lock
echo
echo "Overriding check.lock"
rm /var/run/check.lock
break
fi
myCOUNT=$[$myCOUNT +1]
@ -34,12 +34,14 @@ myIMAGES=$(cat /data/images.conf)
touch /var/run/check.lock
myUPTIME=$(awk '{print int($1/60)}' /proc/uptime)
if [ $myUPTIME -gt 5 ];
if [ $myUPTIME -gt 4 ];
then
for i in $myIMAGES
do
service $i stop
done
echo "Waiting 10 seconds before restarting docker ..."
sleep 10
iptables -w -F
service docker restart
while true
@ -54,15 +56,25 @@ if [ $myUPTIME -gt 5 ];
fi
sleep 0.1
done
echo "Docker is now up and running again."
echo "Removing obsolete container data ..."
docker rm -v $(docker ps -aq)
echo "Removing obsolete image data ..."
docker rmi $(docker images | grep "^<none>" | awk '{print $3}')
echo "Starting T-Pot services ..."
for i in $myIMAGES
do
service $i start
sleep $(((RANDOM %5)+5))
done
sleep 5
else
echo "T-Pot needs to be up and running for at least 5 minutes."
fi
rm /var/run/check.lock
/etc/rc.local
echo "Done. Now running status.sh"
/usr/bin/status.sh