From 1bf84f6a5da2c88def0df3643abe41b11c3b0c89 Mon Sep 17 00:00:00 2001 From: Alan Jack Pippin Date: Sat, 12 Nov 2005 16:40:22 -0700 Subject: [PATCH] Added sourcing of system specific configuration file /etc/lsbackups.conf if it exists. This follows the sourcing of config.sh, allowing overrides of the defaults. --- scripts/burn-imgs.sh | 8 ++++++++ scripts/cron-burn.sh | 7 +++++++ scripts/cron-pack.sh | 7 +++++++ scripts/eject-disk.sh | 7 +++++++ scripts/pack-image.sh | 7 +++++++ 5 files changed, 36 insertions(+) diff --git a/scripts/burn-imgs.sh b/scripts/burn-imgs.sh index 5d030bf..f33ea99 100755 --- a/scripts/burn-imgs.sh +++ b/scripts/burn-imgs.sh @@ -3,8 +3,16 @@ export PATH=$(dirname $0):/bin:/usr/bin:/sbin cronstopstart="/etc/init.d/cron" + +# source the default configuration . config.sh +# source the system specific configuration +if [ -f /etc/lsbackups.conf ] +then + . /etc/lsbackups.conf +fi + # If the noburn file is there then don't burn. [ -f "$noburnfile" ] && exit 0 diff --git a/scripts/cron-burn.sh b/scripts/cron-burn.sh index 4967935..f2ca414 100755 --- a/scripts/cron-burn.sh +++ b/scripts/cron-burn.sh @@ -2,8 +2,15 @@ export PATH=$(dirname $0):/bin:/usr/bin:/sbin +# source the default configuration . config.sh +# source the system specific configuration +if [ -f /etc/lsbackups.conf ] +then + . /etc/lsbackups.conf +fi + # burn-imgs.sh needs to be detached so that it can stop and start cron without # dying itself. diff --git a/scripts/cron-pack.sh b/scripts/cron-pack.sh index a757da9..62c65ad 100755 --- a/scripts/cron-pack.sh +++ b/scripts/cron-pack.sh @@ -2,8 +2,15 @@ export PATH=$(dirname $0):/bin:/usr/bin:/sbin +# source the default configuration . config.sh +# source the system specific configuration +if [ -f /etc/lsbackups.conf ] +then + . /etc/lsbackups.conf +fi + if [ -n "$(find $lastbackupfile -mtime +14)" -o -n "$(cat $statusfile | grep -i incomplete)" ]; then echo "Running backups from cron..." setsid pack-image.sh diff --git a/scripts/eject-disk.sh b/scripts/eject-disk.sh index 32220f1..ca2795c 100755 --- a/scripts/eject-disk.sh +++ b/scripts/eject-disk.sh @@ -2,8 +2,15 @@ export PATH=$(dirname $0):/bin:/usr/bin:/sbin +# source the default configuration . config.sh +# source the system specific configuration +if [ -f /etc/lsbackups.conf ] +then + . /etc/lsbackups.conf +fi + eject $dev rm -f $noburnfile diff --git a/scripts/pack-image.sh b/scripts/pack-image.sh index ec7b1da..9dcc6bf 100755 --- a/scripts/pack-image.sh +++ b/scripts/pack-image.sh @@ -4,8 +4,15 @@ scriptsdir=$(dirname $0) export PATH=$scriptsdir:/bin:/usr/bin:/sbin:/usr/sbin +# source the default configuration . config.sh +# source the system specific configuration +if [ -f /etc/lsbackups.conf ] +then + . /etc/lsbackups.conf +fi + # file locations and other values today=$(date +%Y%m%d%H%M%S) isoimage="$imagedir/$today.img" -- 2.34.1