X-Git-Url: https://git.p6c8.net/nextcloud-backup-restore.git/blobdiff_plain/343e0030aec4e9213a9d432580197510d1f008be..c2fc80907fa47ff4212f123ed2c3458ba3ec40c6:/setup.sh diff --git a/setup.sh b/setup.sh index 1462ea5..ed29c3e 100755 --- a/setup.sh +++ b/setup.sh @@ -3,7 +3,7 @@ # # Bash script an easy setup of NextcloudBackup.sh and NextcloudRestore.sh # -# Version 2.0.0 +# Version 2.3.0 # # Usage: # - call the setup.sh script @@ -19,6 +19,9 @@ # However, you should always check the backup/restore scripts BEFORE executing these! # +# Make sure the script exits when any command fails +set -Eeuo pipefail + # # Pre defined variables # @@ -59,7 +62,7 @@ clear echo "Enter the webserver service name." echo "Usually: nginx or apache2" echo "" -read -p "Enter an new webserver service name or press ENTER if the webserver user is ${webserverUser}: " WEBSERVERSERVICENAME +read -p "Enter an new webserver service name or press ENTER if the webserver service name is ${webserverServiceName}: " WEBSERVERSERVICENAME [ -z "$WEBSERVERSERVICENAME" ] || webserverServiceName=$WEBSERVERSERVICENAME clear @@ -67,6 +70,7 @@ clear echo "Backup directory: ${backupMainDir}" echo "Nextcloud file directory: ${nextcloudFileDir}" echo "Webserver user: ${webserverUser}" +echo "Webserver service name: ${webserverServiceName}" echo "" read -p "Is the information correct? [y/N] " CORRECTINFO @@ -85,7 +89,7 @@ occ_get datadirectory if [ $? -ne 0 ]; then echo "Error calling OCC: Please check if the information provided was correct." - echo "ABORTING!" + echo "ABORTING!" echo "No file has been altered." exit 1 fi