//ip_conflict_check.sh
Start ========================================
#!/bin/sh
#arping -q -D -I DEVICE -c COUNT IP_ADDRESS; echo $?
#ex) arping -q -D -I eth0 -c 1 192.168.0.181; echo $?
#리턴값이 1 이면 이미 네트워크상에 IP가 존재 / 0 이면 중복 IP 없음

out="ip_check_ret.txt"
touch "$out"

arping -q -D -I eth0 -c 1 "$1"

ret=$?
echo "$ret" > "$out"
End ==========================================

실행방법
[root@afewgood /home ~]$ ./ip_conflict_check.sh 192.168.0.254
[root@afewgood /home ~]$  cat ip_check_ret.txt
1    //IP 존재함
[root@afewgood /home ~]$ 

Posted by afewgood
,