diff options
Diffstat (limited to 'coin/provisioning/qtci-linux-Ubuntu-16.04-x86_64/01-systemsetup.sh')
-rwxr-xr-x | coin/provisioning/qtci-linux-Ubuntu-16.04-x86_64/01-systemsetup.sh | 80 |
1 files changed, 18 insertions, 62 deletions
diff --git a/coin/provisioning/qtci-linux-Ubuntu-16.04-x86_64/01-systemsetup.sh b/coin/provisioning/qtci-linux-Ubuntu-16.04-x86_64/01-systemsetup.sh index e00e2498..119a1008 100755 --- a/coin/provisioning/qtci-linux-Ubuntu-16.04-x86_64/01-systemsetup.sh +++ b/coin/provisioning/qtci-linux-Ubuntu-16.04-x86_64/01-systemsetup.sh @@ -37,69 +37,25 @@ set -ex -source "${BASH_SOURCE%/*}/../common/unix/try_catch.sh" source "${BASH_SOURCE%/*}/../common/unix/check_and_set_proxy.sh" NTS_IP=10.212.2.216 -ExceptionGsettings1=100 -ExceptionGsettings2=101 -ExceptionGsettings3=102 -ExceptionNTS=103 -ExceptionProxy=104 -ExceptionGrub=105 - -try -( - echo "Set timezone to UTC." - sudo timedatectl set-timezone Etc/UTC || throw $ExceptionTimezone - echo "Timeout for blanking the screen (0 = never)" - gsettings set org.gnome.desktop.session idle-delay 0 || throw $ExceptionGsettings1 - echo "Prevents screen lock when screesaver goes active." - gsettings set org.gnome.desktop.screensaver lock-enabled false || throw $ExceptionGsettings2 - echo "Disable questions on shutdown." - gsettings set com.canonical.indicator.session suppress-logout-restart-shutdown true || throw $ExceptionGsettings3 - echo "Set grub timeout to 0" - sudo sed -i 's|GRUB_TIMEOUT=10|GRUB_TIMEOUT=0|g' /etc/default/grub || throw $ExceptionGrub - sudo update-grub || throw $ExceptionGrub - - echo "Set Network Test Server address to $NTS_IP in /etc/hosts" - echo "$NTS_IP qt-test-server qt-test-server.qt-test-net" | sudo tee -a /etc/hosts || throw $ExceptionNTS - - if [ "$http_proxy" != "" ]; then - echo "Acquire::http::Proxy \"$proxy\";" | sudo tee -a /etc/apt/apt.conf || throw $ExceptionProxy - fi -) -catch || { - case $ex_code in - $ExceptionTimezone) - echo "Failed to set timezone to UTC" - exit 1; - ;; - $ExceptionGsettings1) - echo "Failed to disable black screen." - exit 1; - ;; - $ExceptionGsettings2) - echo "Failed to prevent screen lock." - exit 1; - ;; - $ExceptionGsettings3) - echo "Failed to disable questions on shutdown." - exit 1; - ;; - $ExceptionGrub) - echo "Failed to set grub timeout." - exit 1; - ;; - $ExceptionNTS) - echo "Failed to set network teset server address into /etc/hosts." - exit 1; - ;; - $ExceptionProxy) - echo "Failed to set proxy /etc/apt/apt.conf." - exit 1; - ;; - esac -} - +echo "Set timezone to UTC." +sudo timedatectl set-timezone Etc/UTC +echo "Timeout for blanking the screen (0 = never)" +gsettings set org.gnome.desktop.session idle-delay 0 +echo "Prevents screen lock when screesaver goes active." +gsettings set org.gnome.desktop.screensaver lock-enabled false +echo "Disable questions on shutdown." +gsettings set com.canonical.indicator.session suppress-logout-restart-shutdown true +echo "Set grub timeout to 0" +sudo sed -i 's|GRUB_TIMEOUT=10|GRUB_TIMEOUT=0|g' /etc/default/grub +sudo update-grub + +echo "Set Network Test Server address to $NTS_IP in /etc/hosts" +echo "$NTS_IP qt-test-server qt-test-server.qt-test-net" | sudo tee -a /etc/hosts + +if [ "$http_proxy" != "" ]; then + echo "Acquire::http::Proxy \"$proxy\";" | sudo tee -a /etc/apt/apt.conf +fi |