Path : /opt/postupcp/ |
Current File : //opt/postupcp/run_arping |
#!/bin/bash # Performs arping to gateway from all IP's source /etc/profile gateway="$(route -n|awk '$4 == "UG" {print$2}')" log="/opt/postupcp/run_arping.log" echo "----$(date)----" >> $log do_arping() { sleeptime=$(( ( $RANDOM % 300 ) + 1 )) echo "Sleeping for $sleeptime seconds" >> $log sleep $sleeptime for ip in $(ip -f inet a | awk -F'[ /]' '/inet.*global/ {print $6}');do arping -c 1 -w 1 -s $ip $gateway >> $log done } do_arping