very basic installation stuff

This commit is contained in:
Marco Ochse
2016-05-12 19:26:06 +02:00
parent 6e3f3b8d24
commit fbfb5a1d90
11 changed files with 45 additions and 39 deletions

View File

@ -4,7 +4,7 @@
# T-Pot #
# ELK DB backup script #
# #
# v16.03.1 by mo, DTAG, 2016-03-09 #
# v16.10.0 by mo, DTAG, 2016-05-12 #
########################################################
myCOUNT=1
myDATE=$(date +%Y%m%d%H%M)
@ -38,7 +38,7 @@ touch /var/run/check.lock
# Stop ELK to lift db lock
echo "Now stopping ELK ..."
service elk stop
systemctl stop elk
sleep 10
# Backup DB in 2 flavors
@ -53,7 +53,7 @@ chmod 760 -R $myELKPATH
chown tpot:tpot -R $myELKPATH
# Start ELK
service elk start
systemctl start elk
echo "Now starting up ELK ..."
# Allow checks to resume

View File

@ -4,7 +4,7 @@
# T-Pot #
# Check container and services script #
# #
# v16.03.1 by mo, DTAG, 2016-03-09 #
# v16.10.0 by mo, DTAG, 2016-05-12 #
########################################################
if [ -a /var/run/check.lock ];
then
@ -29,9 +29,9 @@ for i in $myIMAGES
if [ $myUPTIME -gt 4 ] && [ $myCIDSTATUS -gt 0 ];
then
echo "Restarting "$i"."
service $i stop
systemctl stop $i
sleep 5
service $i start
systemctl start $i
fi
done

View File

@ -4,7 +4,7 @@
# T-Pot #
# Container and services restart script #
# #
# v16.03.1 by mo, DTAG, 2016-03-09 #
# v16.10.0 by mo, DTAG, 2016-05-12 #
########################################################
myCOUNT=1
@ -38,12 +38,12 @@ if [ $myUPTIME -gt 4 ];
then
for i in $myIMAGES
do
service $i stop
systemctl stop $i
done
echo "### Waiting 10 seconds before restarting docker ..."
sleep 10
iptables -w -F
service docker restart
systemctl restart docker
while true
do
docker info > /dev/null
@ -64,7 +64,7 @@ if [ $myUPTIME -gt 4 ];
echo "### Starting T-Pot services ..."
for i in $myIMAGES
do
service $i start
systemctl start $i
done
sleep 5
else

View File

@ -4,7 +4,7 @@
# T-Pot #
# Container and services status script #
# #
# v16.03.1 by mo, DTAG, 2016-03-09 #
# v16.10.0 by mo, DTAG, 2016-05-12 #
########################################################
myCOUNT=1

View File

@ -4,9 +4,11 @@
# T-Pot #
# Only start the containers found in /etc/init/ #
# #
# v16.03.2 by mo, DTAG, 2016-04-20 #
# v16.10.0 by mo, DTAG, 2016-05-12 #
########################################################
echo "### I still need some dev-work!"
# Make sure not to interrupt a check
while true
do
@ -33,19 +35,21 @@ done
touch /var/run/check.lock
# Stop T-Pot services and delete all T-Pot upstart scripts
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo "### Stopping T-Pot services and cleaning up."
for i in $(cat /data/imgcfg/all_images.conf);
do
service $i stop
systemctl stop $i
sleep 2
rm -rf /etc/init/$i.conf || true;
done
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# Restarting docker services
echo "### Restarting docker services ..."
service docker stop
systemctl stop docker
sleep 2
service docker start
systemctl start docker
sleep 2
# Setup only T-Pot upstart scripts from images.conf and pull the images