Jump to content

RyzAleks RA

Forum Members
  • Posts

    1
  • Joined

  • Last visited

Equipment

  • Keenetic
    Extra2

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

RyzAleks RA's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. исковеркал: #!/bin/sh ndmq -x -p "show ip arp" | sed -n '/mac/p; /name/p' > /opt/var/names ndmq -x -p "show associations"|grep "mac" > /opt/var/present diff /opt/var/past /opt/var/present|grep "^[+-]"|grep -v "/opt/var/" > /opt/var/ while read line do if test "${line:0:1}" = '+'; then action="connect" else action="disconnect" fi mac=${line//+} mac=${mac//-} name=`grep -A 1 $mac /opt/var/names|grep -v mac` name=${name//<name>} name=${name//<\/name>} #Здесь шлем мыло, смс или ботом в телеграм с текстом: "$name $action" done < /opt/var/comp ndmq -x -p "show associations"|grep "mac" > /opt/var/past сделано через ж файлы для отладки. есть смысл переписать через переменные P.S. пишу первый раз, так что критика приветствуется
×
×
  • Create New...