timeout from busybox needs -t

pull/4/head
Rick Farina (Zero_Chaos) 2019-12-23 22:14:44 -05:00
parent b224a42e94
commit 115ed70646
No known key found for this signature in database
GPG Key ID: A5DD1427DD11F94A
1 changed files with 1 additions and 1 deletions

View File

@ -50,7 +50,7 @@ case $1 in
#make sure nothing interferes
shut_it_all_down
#this will exit 0 if a dhcp discovery/request packet is seen, and 124 if not
sniffed="$(timeout 15 tcpdump -Z nobody -i eth0 -c 3 udp src port 68 and udp dst port 67 -v 2>&1)"
sniffed="$(timeout -t 15 tcpdump -Z nobody -i eth0 -c 3 udp src port 68 and udp dst port 67 -v 2>&1)"
if echo "${sniffed}" | grep -q 'DHCP-Message Option 53, length 1: Discover' && \
! echo "${sniffed}" | grep -q 'DHCP-Message Option 53, length 1: Request'; then
#we saw a dhcp discover but no dhcp request, so someone wants a dhcp server and didn't find one