mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-17 01:54:49 +00:00
dhcp: upgrade the prefix watcher to production level #5876
Just make a MD5 sum of the file and change polling to 20 seconds. Call backend on first run as well without waiting. Interval could be lower still, but as said earlier it doesn't matter much all things considered.
This commit is contained in:
parent
643328486b
commit
483048b9e6
@ -24,9 +24,17 @@
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
INTERVAL=${1:-60}
|
||||
CHECKSUM="md5 -q"
|
||||
INTERVAL=${1:-20}
|
||||
LEASES="/var/dhcpd/var/db/dhcpd6.leases"
|
||||
PREVIOUS=
|
||||
|
||||
while :; do
|
||||
CURRENT=$(${CHECKSUM} ${LEASES})
|
||||
if [ "${CURRENT}" != "${PREVIOUS}" ]; then
|
||||
configctl dhcpd update prefixes
|
||||
PREVIOUS=${CURRENT}
|
||||
fi
|
||||
|
||||
sleep "${INTERVAL}"
|
||||
configctl dhcpd update prefixes
|
||||
done
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user