Skip to content
Snippets Groups Projects
Verified Commit ac249ae9 authored by David Beniamine's avatar David Beniamine
Browse files

Complete register with dhcp leases

parent f3778dd8
No related merge requests found
......@@ -68,6 +68,17 @@ do
fi
echo "$line $IPS" >> $hostfile-$$
done < $hostfile
# Add data from leases
dhcp-lease-list 2> /dev/null \
| grep '^[0-9a-f][0-9a-f]:' \
| sed 's/\(\S*\)\s*\(\S*\)\s*\(\S*\)\s*\([0-9][0-9][0-9][0-9]\)-\([0-9][0-9]\)-\([0-9][0-9]\).*/\4\5\6 \1 \3 \2 NaN inconnu-recup-depuis-dhcp-leases inconnu NaN/' \
| while read line
do
mac=$(echo $line | cut -d ' ' -f 2)
if [ -z "$(grep $mac $hostfile-$$)" ]; then
echo $line >> $hostfile-$$
fi
done
answer $hostfile-$$
rm $hostfile-$$
elif [[ "$LINE" =~ "getLog" ]]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment