Skip to content

Instantly share code, notes, and snippets.

@yorickdowne
Last active December 15, 2021 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yorickdowne/2f3d70f1c7ea54ff537dd4f958369092 to your computer and use it in GitHub Desktop.
Save yorickdowne/2f3d70f1c7ea54ff537dd4f958369092 to your computer and use it in GitHub Desktop.
#! /bin/bash
# http://linuxcommand.org/wss0150.php
function error_exit
{
echo "$1" 1>&2
exit 1
}
# http://unix.stackexchange.com/questions/70859/why-doesnt-sudo-su-in-a-shell-script-run-the-rest-of-the-script-as-root
if [ `whoami` = root ]; then
apt-get update
apt-get -y install docker.io docker-compose ssmtp
apt-get -y dist-upgrade
usermod -aG docker ubuntu
runuser -u ubuntu -- exec ${BASHSOURCE}
elif [ `whoami` = ubuntu ]; then
cd ~
git clone https://github.com/eth2-educators/eth-docker traefik
else
echo "Should not be here!!!"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment