Hi,
on freebsd, I need to parse custom option received in dhcp response. for the same i want to develop script to log and parse received message. As mentioned in document i've used below configuration in /etc/dhclient.conf. its triggering the script but no passing received dhcp messages as argument. How do i get it workig same?
on freebsd, I need to parse custom option received in dhcp response. for the same i want to develop script to log and parse received message. As mentioned in document i've used below configuration in /etc/dhclient.conf. its triggering the script but no passing received dhcp messages as argument. How do i get it workig same?
Code:
cat /etc/dhclient.conf
#
# This file is required by the ISC DHCP client.
# See ``man 5 dhclient.conf'' for details.
#
# In most cases an empty file is sufficient for most people as the
# defaults are usually fine.
#
script "/usr/local/bin/dhcp-response-handler.sh";
**********************************************
#!/bin/sh
# dhcp-response-handler.sh
LOGFILE="/var/log/dhcp_response.log"
echo "Received DHCP response at $(date):" >> $LOGFILE
echo $# >> $LOGFILE
echo " Raw message: $@" >> $LOGFILE
***************************************************************
Received DHCP response at Sat Sep 21 12:56:18 +06 2024:
0
Raw message: