Files
tpotce/installer/bin/update-images.sh

71 lines
1.6 KiB
Bash
Raw Normal View History

2016-02-08 12:21:03 +01:00
#!/bin/bash
########################################################
# T-Pot #
# Only start the containers found in /etc/init/ #
2016-02-08 12:21:03 +01:00
# #
2016-05-12 19:26:06 +02:00
# v16.10.0 by mo, DTAG, 2016-05-12 #
2016-02-08 12:21:03 +01:00
########################################################
2016-05-12 19:26:06 +02:00
echo "### I still need some dev-work!"
# Make sure not to interrupt a check
while true
do
if ! [ -a /var/run/check.lock ];
then break
fi
sleep 0.1
if [ "$myCOUNT" = "1" ];
then
echo -n "Waiting for services "
else echo -n .
fi
if [ "$myCOUNT" = "6000" ];
then
echo
echo "Overriding check.lock"
rm /var/run/check.lock
break
fi
myCOUNT=$[$myCOUNT +1]
done
# We do not want to get interrupted by a check
touch /var/run/check.lock
2016-03-10 18:40:28 +01:00
# Stop T-Pot services and delete all T-Pot upstart scripts
2016-05-12 19:26:06 +02:00
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2016-03-10 18:40:28 +01:00
echo "### Stopping T-Pot services and cleaning up."
2016-03-10 18:44:59 +01:00
for i in $(cat /data/imgcfg/all_images.conf);
2016-02-08 15:57:27 +01:00
do
2016-05-12 19:26:06 +02:00
systemctl stop $i
2016-03-10 18:40:28 +01:00
sleep 2
2016-05-29 00:03:46 +02:00
systemctl disable $i;
2016-02-08 15:57:27 +01:00
done
2016-05-12 19:26:06 +02:00
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2016-02-08 15:57:27 +01:00
# Restarting docker services
echo "### Restarting docker services ..."
2016-05-12 19:26:06 +02:00
systemctl stop docker
sleep 2
2016-05-12 19:26:06 +02:00
systemctl start docker
sleep 2
# Setup only T-Pot upstart scripts from images.conf and pull the images
2016-02-08 12:21:03 +01:00
for i in $(cat /data/images.conf);
2016-03-09 14:05:06 +01:00
do
docker pull dtagdevsec/$i:latest1603;
2016-05-29 00:03:46 +02:00
systemctl enable $i;
2016-02-08 12:21:03 +01:00
done
2016-02-08 15:57:27 +01:00
# Announce reboot
2016-03-09 14:05:06 +01:00
echo "### Rebooting in 60 seconds for the changes to take effect."
sleep 60
2016-03-10 18:40:28 +01:00
# Allow checks to resume
rm /var/run/check.lock
# Reboot
reboot