]> arthur.barton.de Git - backup-script.git/commitdiff
Enable shell options for safer execution environment
authorAlexander Barton <alex@barton.de>
Mon, 20 Nov 2017 11:15:12 +0000 (12:15 +0100)
committerAlexander Barton <alex@barton.de>
Mon, 20 Nov 2017 11:15:26 +0000 (12:15 +0100)
bin/backup-audit
bin/backup-script
bin/backup-status

index 4f3358674f0ca5ca2dc7771909c366a3df32da8d..0dc2995f5925b5da2166067624090a63c0420603 100755 (executable)
@@ -27,6 +27,10 @@ default_files="running-config"
 default_generations=0
 default_target="/var/backups"
 
+# Set shell options.
+shopt -s nullglob
+set -o pipefail
+
 # Search configuration file (last one is used as default!)
 for conf in \
        "/usr/local/etc/backup-script.conf" \
index 84180d3e5e0d1c366b2cb7135e2aa13a755a549b..395fe9e93d194f3ab60c46502c5c167648edbd4d 100755 (executable)
@@ -53,6 +53,10 @@ default_job_pre_exec=""
 default_job_post_exec=""
 default_tags=""
 
+# Set shell options.
+shopt -s nullglob
+set -o pipefail
+
 Usage() {
        {
                echo "Usage: $NAME [<options>] [<job> [<job> [...]]]"
index 1f68760186931cab61979c1c9f4a7d437d41d401..8486873d28f10a90236e0ce315a91f47f49ff1dd 100755 (executable)
@@ -29,6 +29,10 @@ default_backup_type="rsync"
 default_generations=0
 default_target="/var/backups"
 
+# Set shell options.
+shopt -s nullglob
+set -o pipefail
+
 # Search configuration file (last one is used as default!)
 for conf in \
        "/usr/local/etc/backup-script.conf" \