diff --git a/first-boot.sh.tmpl b/first-boot.sh.tmpl index 32d4f9e..986c8ac 100644 --- a/first-boot.sh.tmpl +++ b/first-boot.sh.tmpl @@ -11,6 +11,23 @@ # along with this file. If not, see . set -e -certbot certonly --standalone -d DOMAIN -m LETSENCRYPT_EMAIL -herd restart mumble-server -herd restart nginx \ No newline at end of file +report() +{ + ret=$? + message="$@" + + if [ ${ret} -eq 0 ] ; then + echo "[ OK ] ${message}" + else + echo "[ !! ] ${message} failed" + exit ${ret} + fi +} + +echo ';;L;*' | sfdisk -f /dev/vda ; report "Resizing /dev/vda1 partition" ; \ +partprobe +resize2fs /dev/vda1 ; report "Growing /dev/vda1 filesystem" + +certbot certonly --standalone -d DOMAIN -m LETSENCRYPT_EMAIL ; report "Obtaining Lets's Encrypt certificate" +herd restart mumble-server ; report "Restarting Mumble server" +herd restart nginx ; report "Restarting Nginx server"