Skip to content
Snippets Groups Projects
Select Git revision
  • 709bcc58d7a766d135f37735e22197eebb6c80af
  • main default protected
  • export
  • 28-conversion-tests
  • extraction
  • exploration
  • exploration-old
  • 2-encoding-fix
  • main-old
9 results

debug.rq

Blame
  • regenerate_hosts.sh 702 B
    #!/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"
    registry="/etc/registry/hosts"
    cp -v $registry "$registry-$(date '+%Y%m%d_%H%M')"
    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
            mac=$(echo $line | sed 's/;$//g')
            if [ -z "$(grep $mac $registry)" ]
            then
                MACS="$MACS $mac"
            fi
        fi
    done
    for mac in $MACS
    do
        echo "$(date '+%Y%m%d') $mac inconnuAutoGen" >> $registry
    done
    systemctl restart registry wakeonlan