summaryrefslogtreecommitdiffstats
path: root/etc/rc.backup_dhcpleases.sh
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 /etc/rc.backup_dhcpleases.sh
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.
Diffstat (limited to 'etc/rc.backup_dhcpleases.sh')
-rwxr-xr-xetc/rc.backup_dhcpleases.sh8
1 files changed, 5 insertions, 3 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
OpenPOWER on IntegriCloud