From 09f6784b2e2d8377fa646e09caac13931d5c2731 Mon Sep 17 00:00:00 2001 From: Xavier Petit <32063953+xpetit@users.noreply.github.com> Date: Thu, 12 Sep 2019 13:44:39 +0100 Subject: [PATCH] Make kickstart safer --- scripts/kickstart.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/scripts/kickstart.sh b/scripts/kickstart.sh index 51255f129..d54ad75c1 100755 --- a/scripts/kickstart.sh +++ b/scripts/kickstart.sh @@ -4,6 +4,34 @@ # # bash <(curl -Ss raw.githubusercontent.com/01-edu/public/master/scripts/kickstart.sh) +# Treat unset variables as an error when substituting. +set -u + +# Exit immediately if a command exits with a non-zero status. +set -e + +# Set the variable corresponding to the return value of a pipeline is the status +# of the last command to exit with a non-zero status, or zero if no command +# exited with a non-zero status +set -o pipefail + +# Separate tokens on newlines only +IFS=' +' + +# The value of this parameter is expanded like PS1 and the expanded value is the +# prompt printed before the command line is echoed when the -x option is set +# (see The Set Builtin). The first character of the expanded value is replicated +# multiple times, as necessary, to indicate multiple levels of indirection. +# \D{%F %T} prints date like this : 2019-12-31 23:59:59 +PS4='-\D{%F %T} ' + +# Print commands and their arguments as they are executed. +set -x + +# Skip dialogs during apt-get install commands +export DEBIAN_FRONTEND=noninteractive # DEBIAN_PRIORITY=critical + gsettings set org.gnome.desktop.session idle-delay 0 gsettings set org.gnome.desktop.screensaver lock-enabled false wget github.com/01-edu/public/archive/master.zip