summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-10-04 13:26:59 +0000
committerErmal <eri@pfsense.org>2010-10-04 13:26:59 +0000
commite9b0bcf765bd8238d45ec74461c66b13f98709b0 (patch)
treee2407ffe90f2cc9fc3cbc341075f7bbb77689b9e
parentb211666fb3dc83013b6b10720fa7be6cd9e678c0 (diff)
downloadpfsense-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-xetc/rc.backup_dhcpleases.sh8
-rwxr-xr-xetc/rc.backup_rrd.sh8
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
OpenPOWER on IntegriCloud