use new docker repo, update fix script

This commit is contained in:
t3chn0m4g3 2015-08-14 16:39:02 +02:00
parent f9241615d2
commit 3f810c2c73
2 changed files with 20 additions and 13 deletions

View file

@ -3,7 +3,7 @@
# T-Pot Community Edition post install script #
# Ubuntu server 14.04, x64 #
# #
# v0.48 by mo, DTAG, 2015-07-08 #
# v0.49 by mo, DTAG, 2015-08-14 #
########################################################
# Let's make sure there is a warning if running for a second time
@ -29,22 +29,20 @@ fuECHO () {
# Let's modify the sources list
sed -i '/cdrom/d' /etc/apt/sources.list
# Let's add the docker repository
fuECHO "### Adding docker repository."
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
tee /etc/apt/sources.list.d/docker.list <<EOF
deb https://get.docker.io/ubuntu docker main
EOF
# Let's pull some updates
fuECHO "### Pulling Updates."
apt-get update -y
fuECHO "### Installing Updates."
fuECHO "### Installing Upgrades."
apt-get dist-upgrade -y
# Let's install docker
fuECHO "### Installing docker."
wget -qO- https://get.docker.com/gpg | apt-key add -
wget -qO- https://get.docker.com/ | sh
# Let's install all the packages we need
fuECHO "### Installing packages."
apt-get install curl ethtool git ntp libpam-google-authenticator lxc-docker-1.7.0 vim -y
apt-get install curl ethtool git ntp libpam-google-authenticator vim -y
# Let's add a new user
fuECHO "### Adding new user."
@ -119,6 +117,9 @@ tee -a /etc/crontab <<EOF
# Update IP and erase check.lock if it exists
27 15 * * * root /etc/rc.local
# Check for updated packages every sunday, upgrade and reboot
27 16 * * 0 root sleep \$((RANDOM %600)); apt-get autoclean -y; apt-get autoremove -y; apt-get update -y; apt-get upgrade -y; apt-get upgrade docker-engine -y; sleep 5; reboot
EOF
# Let's take care of some files and permissions

View file

@ -3,7 +3,7 @@
# T-Pot Community Edition #
# Volume bug fix script #
# #
# v0.01 by mo, DTAG, 2015-08-07 #
# v0.02 by mo, DTAG, 2015-08-14 #
########################################################
myFIXPATH="/tpot-volume-fix"
myLOCK="/var/run/check.lock"
@ -32,8 +32,9 @@ apt-get autoremove -y
rm -rf /var/lib/docker/
rm -rf /var/run/docker/
# Let's reinstall docker again
apt-get install lxc-docker -y
# Let's reinstall docker using the new docker repo (old one is deprecated)
wget -qO- https://get.docker.com/gpg | apt-key add -
wget -qO- https://get.docker.com/ | sh
# Let's pull the images
for i in $(cat $myIMAGECONFPATH); do /usr/bin/docker pull dtagdevsec/$i:latest; done
@ -44,6 +45,11 @@ cp $myFIXPATH/tpotce/installer/bin/check.sh /usr/bin/
cp $myFIXPATH/tpotce/installer/bin/dcres.sh /usr/bin/
for i in $(cat $myIMAGECONFPATH); do cp $myFIXPATH/tpotce/installer/upstart/$i.conf /etc/init/; done
cp $myFIXPATH/crontab /etc/
tee -a /etc/crontab <<EOF
# Check for updated packages every sunday, upgrade and reboot
27 16 * * 0 root sleep \$((RANDOM %600)); apt-get autoclean -y; apt-get autoremove -y; apt-get update -y; apt-get upgrade -y; apt-get upgrade docker-engine -y; sleep 5; reboot
EOF
# Let's remove the check.lock and allow scripts to execute again
rm $myLOCK