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

Reegenerate host file

parent 6e8c1005
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
BASE_MACS="6c:4b:90 a4:1f:72 78:45:c4 64:00:6a b0:83:fe d4:be:d9 00:23:24"
arg="c8:1f:66"
for mac in $BASE_MACS
do
arg="$arg \| $mac"
done
echo grep "$arg" /var/lib/dhcp/dhcpd.leases
MACS=""
for line in $(grep "$arg" /var/lib/dhcp/dhcpd.leases | sort -u)
do
if [ "$line" != "hardware" ] && [ "$line" != "ethernet" ]
then
MACS="$MACS $(echo $line | sed 's/;$//g')"
fi
done
for mac in $MACS
do
echo "20191025 $mac inconnuAutoGen" >> /etc/registry/hosts
done
systemctl restart registry wakeonlan
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment