Site Tools


retain_dhcp_lease_info_after_a_reboot

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
retain_dhcp_lease_info_after_a_reboot [2023/08/09 15:41] – [Method 1: Store the lease database on permanent storage] -condense hogwildretain_dhcp_lease_info_after_a_reboot [2023/08/15 18:32] (current) – [Method 2: Copying the lease database to permanent storage at halt time] petervdm
Line 28: Line 28:
 <code -> <code ->
 [ -f /mnt/usb/dnsmasq.leases ] && { [ -f /mnt/usb/dnsmasq.leases ] && {
- sort -b -k 2 -u -z /tmp/var/lib/misc/dnsmasq.leases > /tmp/dnsmasq.tmp1 +sort -b -k 2 -u -z /tmp/var/lib/misc/dnsmasq.leases > /tmp/dnsmasq.tmp1 
- sort -b -k 2 -u -z /mnt/usb/dnsmasq.leases > /tmp/dnsmasq.tmp2 +sort -b -k 2 -u -z /mnt/usb/dnsmasq.leases > /tmp/dnsmasq.tmp2 
- diff -a /tm +diff -a /tmp/dnsmasq.tmp1 /tmp/dnsmasq.tmp2 | grep -E '^>' | sed 's/^>\ //' >> /tmp/var/lib/misc/dnsmasq.leases 
- kill -HUP `ps | grep  +kill -HUP `ps | grep -E [d]nsmasq | awk '{ print $1 }'` 
- rm /tmp/dnsmasq.tmp1 +rm /tmp/dnsmasq.tmp1 
- rm /tmp/dnsmasq.tmp2+rm /tmp/dnsmasq.tmp2 
 +rm -f /mnt/usb/dnsmasq.leases
 } }
 </code> </code>
retain_dhcp_lease_info_after_a_reboot.txt · Last modified: 2023/08/15 18:32 by petervdm