From: Alan Jack Pippin Date: Sat, 12 Nov 2005 23:40:22 +0000 (-0700) Subject: Added sourcing of system specific configuration file /etc/lsbackups.conf if it exists. X-Git-Tag: release-0.4~19 X-Git-Url: http://git.pippins.net/embedvideo/images/%27%20%20%20%20.%20%24GLOBALS%5B%27phpgw%27%5D-%3Elink%28%27inc/jquery/static/gitweb.js?a=commitdiff_plain;h=1bf84f6a5da2c88def0df3643abe41b11c3b0c89;p=backups%2F.git 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. --- 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"