#!/bin/perl use strict; use warnings; use sigtrap; use diagnostics; my $mac="ff:ff:ff:ff:ff:ff"; my $command = system (`tshark -i eth0 -n port 68 -R 'bootp.type == 2' +-o column.format:'"Source MAC","%hs"'`); if ($command ne $mac) { system ('echo "match" | /usr/bin/mail -s "mac_found" user@foo. +com'); }
In reply to get mac addr, compare & send out email by chris_henderson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |