Created
August 18, 2016 21:12
-
-
Save MTRNord/824bc53f426a022b2e8e74684fc51837 to your computer and use it in GitHub Desktop.
Installer for the Mapit-Germany Docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$(id -u)" != "0" ]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi | |
echo -e "Getting User Data\n" | |
echo -e "-------------------\n \n" | |
echo -e "Tell Ubuntu Verison name [precise, trusty, wily, xenial]:" | |
read version | |
echo -e "Install docker" | |
touch /etc/apt/sources.list.d/docker.list | |
echo "deb https://apt.dockerproject.org/repo ubuntu-$version main" >> /etc/apt/sources.list.d/docker.list | |
apt-get update | |
apt-get purge lxc-docker | |
apt-get install docker-engine make | |
groupadd docker | |
usermod -aG docker daemon | |
echo -e "Add run scripts" | |
function systemd_service { | |
systemctl start docker | |
wget https://raw.githubusercontent.com/Nordgedanken/mapit-germany-docker/master/mapit_systemd | |
mv mapit_systemd /etc/systemd/system/mapit.service | |
chmod +x /etc/systemd/system/mapit.service | |
} | |
function init_service { | |
service docker start | |
wget https://raw.githubusercontent.com/Nordgedanken/mapit-germany-docker/master/mapit_init | |
mv mapit_init /etc/init.d/mapit | |
chmod +x /etc/init.d/mapit | |
} | |
pidof systemd && systemd_service || init_service | |
echo -e "Ready to start\n\n Now rin 'sudo service mapit start'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment