summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2010-08-06 12:03:48 -0400
committerjim-p <jimp@pfsense.org>2010-08-06 12:03:48 -0400
commit6b5a20abe87cff8562c0789396631c1dc0651350 (patch)
tree38537432640317dcddd5f85bf3818d0f67b0fb5f /etc
parentef68d19ce1ec4c6f23c6e350340ccb7e6a2448d7 (diff)
downloadpfsense-6b5a20abe87cff8562c0789396631c1dc0651350.zip
pfsense-6b5a20abe87cff8562c0789396631c1dc0651350.tar.gz
Backup DHCP leases on NanoBSD too
Diffstat (limited to 'etc')
-rw-r--r--etc/rc.backup_dhcpleases.sh6
-rwxr-xr-xetc/rc.reboot1
-rwxr-xr-xetc/rc.shutdown1
3 files changed, 8 insertions, 0 deletions
diff --git a/etc/rc.backup_dhcpleases.sh b/etc/rc.backup_dhcpleases.sh
new file mode 100644
index 0000000..22cc219
--- /dev/null
+++ b/etc/rc.backup_dhcpleases.sh
@@ -0,0 +1,6 @@
+#!/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
diff --git a/etc/rc.reboot b/etc/rc.reboot
index ff5a5fc..851f1a8 100755
--- a/etc/rc.reboot
+++ b/etc/rc.reboot
@@ -16,6 +16,7 @@ if [ "$PLATFORM" = "pfSense" ]; then
rm -rf /tmp/*
else
/etc/rc.backup_rrd.sh
+ /etc/rc.backup_dhcpleases.sh
fi
sleep 1
diff --git a/etc/rc.shutdown b/etc/rc.shutdown
index 7d4d32f..257a577 100755
--- a/etc/rc.shutdown
+++ b/etc/rc.shutdown
@@ -31,4 +31,5 @@ if [ "$PLATFORM" = "pfSense" ]; then
rm -rf /tmp/*
else
/etc/rc.backup_rrd.sh
+ /etc/rc.backup_dhcpleases.sh
fi
OpenPOWER on IntegriCloud