Skip to content

Commit

Permalink
dnsmasq persist lease
Browse files Browse the repository at this point in the history
Inititial Commit
  • Loading branch information
stevo119 committed Sep 2, 2019
1 parent a3abf3a commit bdf1bd9
Show file tree
Hide file tree
Showing 6 changed files with 523 additions and 0 deletions.
9 changes: 9 additions & 0 deletions vyatta-cfg-dhcp-server.patch/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Package: vyatta-cfg-dhcp-server.patch
Version: 1.0-2
Section: base
Priority: optional
Architecture: all
Depends: vyatta-cfg-dhcp-server
Maintainer: Steven Myers <[email protected]>
Description: Patch dnsmasq with optional static lease file

4 changes: 4 additions & 0 deletions vyatta-cfg-dhcp-server.patch/DEBIAN/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
chksrv="systemctl is-active --quiet dnsmasq"
if $chksrv; then exit 1; else systemctl start dnsmasq; fi
exit 0
3 changes: 3 additions & 0 deletions vyatta-cfg-dhcp-server.patch/DEBIAN/postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
file="/opt/vyatta/sbin/dnsmasq-dhcp-config.pl"
dpkg-divert --remove --package vyatta-cfg-dhcp-server.patch --rename $file
18 changes: 18 additions & 0 deletions vyatta-cfg-dhcp-server.patch/DEBIAN/preinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
# vyatta-cfg-dhcp-server.patch
# Checks for valid check sum and proceeds with install
file="/opt/vyatta/sbin/dnsmasq-dhcp-config.pl"
fileold="/opt/vyatta/sbin/dnsmasq-dhcp-config.pl.old"
sum="dae0b9fa8b6e0f52712746830a2029cb"
chksrv="systemctl is-active --quiet dnsmasq"
md5=($(md5sum $file))
[ ! -f "$file" ] && exit 1
if [ $md5 == $sum ]; then
if $chksrv; then systemctl stop dnsmasq; fi
dpkg-divert --add --package vyatta-cfg-dhcp-server.patch --rename --divert $fileold $file
echo "ok"
exit 0
else
echo "no file"
exit 1
fi
Loading

0 comments on commit bdf1bd9

Please sign in to comment.