mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-07-02 01:27:27 -04:00
Installer upgrade
This commit is contained in:
42
installer/bin/check.sh
Executable file
42
installer/bin/check.sh
Executable file
@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
|
||||
########################################################
|
||||
# T-Pot Community Edition #
|
||||
# Check container and services script #
|
||||
# #
|
||||
# v0.10 by mo, DTAG, 2015-01-27 #
|
||||
########################################################
|
||||
|
||||
if [ -f /var/run/check.lock ];
|
||||
then exit
|
||||
fi
|
||||
|
||||
touch /var/run/check.lock
|
||||
|
||||
myUPTIME=$(awk '{print int($1/60)}' /proc/uptime)
|
||||
for i in dionaea elk ews glastopf honeytrap kippo suricata
|
||||
do
|
||||
myCIDSTATUS=$(docker exec -i $i supervisorctl status)
|
||||
if [ $? -ne 0 ]; then
|
||||
myCIDSTATUS=1
|
||||
else
|
||||
myCIDSTATUS=$(echo $myCIDSTATUS | egrep -c "(STOPPED|FATAL)")
|
||||
fi
|
||||
if [ $myCIDSTATUS -gt 0 ]; then
|
||||
if [ $myUPTIME -gt 5 ]; then
|
||||
service docker stop
|
||||
docker rm $(docker ps -aq)
|
||||
service docker start
|
||||
for j in dionaea glastopf honeytrap kippo suricata ews elk
|
||||
do
|
||||
sleep 10
|
||||
service $j start
|
||||
done
|
||||
rm /var/run/check.lock
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
rm /var/run/check.lock
|
||||
|
33
installer/bin/status.sh
Executable file
33
installer/bin/status.sh
Executable file
@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
|
||||
########################################################
|
||||
# T-Pot Community Edition #
|
||||
# Container and services status script #
|
||||
# #
|
||||
# v0.10 by mo, DTAG, 2015-01-27 #
|
||||
########################################################
|
||||
myCOUNT=1
|
||||
while true
|
||||
do
|
||||
if ! [ -f /var/run/check.lock ];
|
||||
then break
|
||||
fi
|
||||
sleep 0.1
|
||||
if [ $myCOUNT = 1 ];
|
||||
then
|
||||
echo -n "Waiting for services "
|
||||
else echo -n .
|
||||
fi
|
||||
myCOUNT=$[$myCOUNT +1]
|
||||
done
|
||||
echo
|
||||
echo
|
||||
echo "****************** $(date) ******************"
|
||||
echo
|
||||
echo
|
||||
for i in dionaea elk ews glastopf honeytrap kippo suricata
|
||||
do
|
||||
echo "======| Container:" $i "|======"
|
||||
docker exec -i $i supervisorctl status | GREP_COLORS='mt=01;32' egrep --color=always "(RUNNING)|$" | GREP_COLORS='mt=01;31' egrep --color=always "(STOPPED|FATAL)|$"
|
||||
echo
|
||||
done
|
Reference in New Issue
Block a user