From 2177f5af642e6c80014f8f10bd7cc6c6261aa62c Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Mon, 20 Nov 2017 12:15:12 +0100 Subject: [PATCH] Enable shell options for safer execution environment --- bin/backup-audit | 4 ++++ bin/backup-script | 4 ++++ bin/backup-status | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/bin/backup-audit b/bin/backup-audit index 4f33586..0dc2995 100755 --- a/bin/backup-audit +++ b/bin/backup-audit @@ -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" \ diff --git a/bin/backup-script b/bin/backup-script index 84180d3..395fe9e 100755 --- a/bin/backup-script +++ b/bin/backup-script @@ -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 [] [ [ [...]]]" diff --git a/bin/backup-status b/bin/backup-status index 1f68760..8486873 100755 --- a/bin/backup-status +++ b/bin/backup-status @@ -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" \ -- 2.39.2