From: Michael Prokop Date: Thu, 8 May 2014 09:41:56 +0000 (+0200) Subject: grml-network: fix nmap usage for recent nmap versions X-Git-Tag: v0.8.1~1 X-Git-Url: http://git.grml.org/?p=grml-network.git;a=commitdiff_plain;h=f2a7156cff28f81b5f74c87cd04a20f22cb5b67c grml-network: fix nmap usage for recent nmap versions The --max_rtt_timeout setting wants us to use 4000ms instead of 4000: | % nmap -sP --host_timeout 4000 --max_rtt_timeout 4000 192.168.88.1 :( | Since April 2010, the default unit for --max-rtt-timeout is seconds, so your time of "4000" is 4000 seconds. Use "4000ms" for 4000 milliseconds. | QUITTING! This finally reports correct online/offline status again. --- diff --git a/sbin/grml-network b/sbin/grml-network index 4905f39..7f47cd4 100755 --- a/sbin/grml-network +++ b/sbin/grml-network @@ -55,7 +55,7 @@ main(){ STATUS="" GW="`echo $(route -n | awk '/^0\.0\.0\.0/{print $2}')`" GWDEV="`echo $(route -n | awk '/^0\.0\.0\.0/{print $NF}')`" - NMAP="$(nmap -sP --host_timeout 4000 --max_rtt_timeout 4000 $GW 2>/dev/null)" + NMAP="$(nmap -sP --host_timeout 4000 --max_rtt_timeout 4000ms $GW 2>/dev/null)" if [ "$?" = 0 ]; then echo "$NMAP" | grep -q "down" >/dev/null 2>&1 || STATUS="online"