mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 08:09:41 +00:00
rc: backup DUID for /var MFS et al
Make sure to delete the backup prior to backing up to mimick the current system state. Same goes for restore, no backup means remove the DUID to sync the system state to what it was.
This commit is contained in:
parent
b64b378219
commit
533ccbde0c
1
plist
1
plist
@ -74,6 +74,7 @@
|
||||
/usr/local/etc/rc
|
||||
/usr/local/etc/rc.backup_captiveportal
|
||||
/usr/local/etc/rc.backup_dhcpleases
|
||||
/usr/local/etc/rc.backup_duid
|
||||
/usr/local/etc/rc.backup_netflow
|
||||
/usr/local/etc/rc.backup_rrd
|
||||
/usr/local/etc/rc.bootup
|
||||
|
||||
16
src/etc/rc.backup_duid
Executable file
16
src/etc/rc.backup_duid
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
BACKUPFILE="/conf/dhcp6c_duid"
|
||||
BACKUPTARGET="/var/db/dhcp6c_duid"
|
||||
|
||||
if [ "${1}" = "restore" ]; then
|
||||
rm -f "${BACKUPTARGET}"
|
||||
if [ -f "${BACKUPFILE}" ]; then
|
||||
cp "${BACKUPFILE}" "${BACKUPTARGET}"
|
||||
fi
|
||||
else
|
||||
rm -f "${BACKUPFILE}"
|
||||
if [ -f "${BACKUPTARGET}" ]; then
|
||||
cp "${BACKUPTARGET}" "${BACKUPFILE}"
|
||||
fi
|
||||
fi
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Restore backups from previous shutdown
|
||||
for BACKUP in captiveportal dhcpleases netflow rrd; do
|
||||
for BACKUP in captiveportal dhcpleases duid netflow rrd; do
|
||||
/usr/local/etc/rc.backup_${BACKUP} restore
|
||||
done
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Backup volatile internals
|
||||
for BACKUP in captiveportal dhcpleases netflow rrd; do
|
||||
/usr/local/etc/rc.backup_${BACKUP} stop
|
||||
for BACKUP in captiveportal dhcpleases duid netflow rrd; do
|
||||
/usr/local/etc/rc.backup_${BACKUP}
|
||||
done
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user