diff options
author | Ermal <eri@pfsense.org> | 2010-10-04 13:26:59 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-10-04 13:26:59 +0000 |
commit | e9b0bcf765bd8238d45ec74461c66b13f98709b0 (patch) | |
tree | e2407ffe90f2cc9fc3cbc341075f7bbb77689b9e | |
parent | b211666fb3dc83013b6b10720fa7be6cd9e678c0 (diff) | |
download | pfsense-e9b0bcf765bd8238d45ec74461c66b13f98709b0.zip pfsense-e9b0bcf765bd8238d45ec74461c66b13f98709b0.tar.gz |
Ticket #931. Check that directory exist before trying to tar up. Do this for rrd and dhcpleases scripts used during shutdown.
-rwxr-xr-x | etc/rc.backup_dhcpleases.sh | 8 | ||||
-rwxr-xr-x | etc/rc.backup_rrd.sh | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/etc/rc.backup_dhcpleases.sh b/etc/rc.backup_dhcpleases.sh index 22cc219..73f83a8 100755 --- a/etc/rc.backup_dhcpleases.sh +++ b/etc/rc.backup_dhcpleases.sh @@ -1,6 +1,8 @@ #!/bin/sh # Save the DHCP lease database to the config path. -/etc/rc.conf_mount_rw -cd / && tar -czf /cf/conf/dhcpleases.tgz -C / var/dhcpd/var/db/ -/etc/rc.conf_mount_ro +if [ -d "/var/dhcpd/var/db" ]; then + /etc/rc.conf_mount_rw + cd / && tar -czf /cf/conf/dhcpleases.tgz -C / var/dhcpd/var/db/ + /etc/rc.conf_mount_ro +fi diff --git a/etc/rc.backup_rrd.sh b/etc/rc.backup_rrd.sh index 2e93b64..b39578d 100755 --- a/etc/rc.backup_rrd.sh +++ b/etc/rc.backup_rrd.sh @@ -1,6 +1,8 @@ #!/bin/sh # Save the rrd databases to the config path. -/etc/rc.conf_mount_rw -cd / && tar -czf /cf/conf/rrd.tgz -C / var/db/rrd/*.rrd -/etc/rc.conf_mount_ro +if [ -d "/var/db/rrd" ]; then + /etc/rc.conf_mount_rw + cd / && tar -czf /cf/conf/rrd.tgz -C / var/db/rrd/*.rrd + /etc/rc.conf_mount_ro +fi |