#!/bin/bash ######################################################## # T-Pot Community Edition post install script # # Ubuntu server 14.04, x64 # # # # v0.30 by mo, DTAG, 2015-01-27 # ######################################################## # Let's make sure there is a warning if running for a second time if [ -f install.log ]; then fuECHO "### Running more than once may complicate things. Erase install.log if you are really sure." exit 1; fi # Let's log for the beauty of it set -e exec 2> >(tee "install.err") exec > >(tee "install.log") # Let's create a function for colorful output fuECHO () { local myRED=1 local myWHT=7 tput setaf $myRED echo $1 "$2" tput setaf $myWHT } # 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 <> /etc/init/ssh.override # Let's patch docker defaults, so we can run images as service fuECHO "### Patching docker defaults." tee -a /etc/default/docker < /dev/tty2 # Check if containers and services are up */5 * * * * root /usr/bin/check.sh EOF # Let's update rc.local fuECHO "### Updating rc.local." tee /etc/rc.local.new <