#!/bin/bash <. LICENSE IF='eth0' OUT='js/input.php' SLEEP='60' TEMP=$(getopt -o i:o:s:-n "pamela arp scanner" -- "$@") if [ $? != 0 ] ; then echo "Could not parse parameters..." >&2 ; exit 1 ; fi eval set "$TEMP" -- while true do case "$1" in -i) IF="$2"; shift;; -o) OUT="$2"; shift;; -s) SLEEP="$2"; shift;; --) break;; esac shift done while true do echo $(date)" scanning..." O=""; O="$O"' ' O="$O"' [ ' O="$O"$(arp-scan -R -i 10 --interface "$IF" --localnet | awk '{ print "\""$2"\", " }' | grep :.*: | sort | uniq) O="$O"' ] ' echo "$O" echo "$O" > "$OUT" echo $(date)" sleeping..." sleep "$SLEEP" done