improvements

This commit is contained in:
Marco Ochse
2017-03-13 16:10:37 +00:00
parent b4f157d020
commit fddfc68ff3
2 changed files with 25 additions and 16 deletions

View File

@ -10,13 +10,11 @@ dnslist=(
"dig +short myip.opendns.com @resolver2.opendns.com" "dig +short myip.opendns.com @resolver2.opendns.com"
"dig +short myip.opendns.com @resolver3.opendns.com" "dig +short myip.opendns.com @resolver3.opendns.com"
"dig +short myip.opendns.com @resolver4.opendns.com" "dig +short myip.opendns.com @resolver4.opendns.com"
# "dig +short -t txt o-o.myaddr.l.google.com @ns1.google.com"
"dig +short -4 -t a whoami.akamai.net @ns1-1.akamaitech.net" "dig +short -4 -t a whoami.akamai.net @ns1-1.akamaitech.net"
"dig +short whoami.akamai.net @ns1-1.akamaitech.net" "dig +short whoami.akamai.net @ns1-1.akamaitech.net"
) )
httplist=( httplist=(
# 4.ifcfg.me
alma.ch/myip.cgi alma.ch/myip.cgi
api.infoip.io/ip api.infoip.io/ip
api.ipify.org api.ipify.org
@ -32,7 +30,6 @@ httplist=(
ip.tyk.nu ip.tyk.nu
l2.io/ip l2.io/ip
smart-ip.net/myip smart-ip.net/myip
# tnx.nl/ip
wgetip.com wgetip.com
whatismyip.akamai.com whatismyip.akamai.com
) )

View File

@ -1,11 +1,11 @@
#!/bin/bash #!/bin/bash
######################################################## ##########################################################
# T-Pot # # T-Pot #
# Only start the containers found in /etc/init/ # # Only start the containers found in /etc/systemd/system #
# # # #
# v16.10.0 by mo, DTAG, 2016-05-12 # # v17.06 by mo, DTAG, 2017-03-13 #
######################################################## ##########################################################
# Make sure not to interrupt a check # Make sure not to interrupt a check
while true while true
@ -34,30 +34,42 @@ touch /var/run/check.lock
# Stop T-Pot services and disable all T-Pot services # Stop T-Pot services and disable all T-Pot services
echo "### Stopping T-Pot services and cleaning up." echo "### Stopping T-Pot services and cleaning up."
for i in $(cat /data/imgcfg/all_images.conf); for i in $(cat /data/images.conf);
do do
systemctl stop $i systemctl stop $i
sleep 2 sleep 2
systemctl disable $i; systemctl disable $i;
rm /etc/systemd/system/$i.service
done done
# Restarting docker services # Restarting docker services and optionally clear local repository
echo "### Restarting docker services ..." echo "### Stopping docker services ..."
systemctl stop docker systemctl stop docker
sleep 2 sleep 1
# If option "hard" clear the whole repository
if [ "$1" = "hard" ];
then
echo "### Clearing local docker repository."
rm -rf /var/lib/docker
sleep 1
fi
echo "### Starting docker services ..."
systemctl start docker systemctl start docker
sleep 2 sleep 1
# Enable only T-Pot upstart scripts from images.conf and pull the images # Enable only T-Pot upstart scripts from images.conf and pull the images
for i in $(cat /data/images.conf); for i in $(cat /data/images.conf);
do do
echo
echo "### Now pulling "$i
docker pull dtagdevsec/$i:1706; docker pull dtagdevsec/$i:1706;
cp /data/systemd/$i.service /etc/systemd/system/
systemctl enable $i; systemctl enable $i;
done done
# Announce reboot # Announce reboot
echo "### Rebooting in 60 seconds for the changes to take effect." echo
sleep 60 echo "### Rebooting."
# Allow checks to resume # Allow checks to resume
rm /var/run/check.lock rm /var/run/check.lock