From f2a7156cff28f81b5f74c87cd04a20f22cb5b67c Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Thu, 8 May 2014 11:41:56 +0200 Subject: [PATCH] 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. --- sbin/grml-network | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" -- 2.1.4