summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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