From 474b4e7edf273e50e6a80507966e54726609b1d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=BD=93=E4=B8=80?= Date: Tue, 17 Jun 2014 18:00:09 +0800 Subject: [PATCH] fix a bug when ipv6 is enabled and OLDGW gets empty. --- chnroutes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chnroutes.py b/chnroutes.py index 1053854..65a8659 100755 --- a/chnroutes.py +++ b/chnroutes.py @@ -70,7 +70,7 @@ def generate_mac(metric): #!/bin/sh export PATH="/bin:/sbin:/usr/sbin:/usr/bin" - OLDGW=`netstat -nr | grep '^default' | grep -v 'ppp' | sed 's/default *\\([0-9\.]*\\) .*/\\1/'` + OLDGW=`netstat -nr | grep '^default' | grep -v 'ppp' | sed 's/default *\\([0-9\.]*\\) .*/\\1/' | grep .` if [ ! -e /tmp/pptp_oldgw ]; then echo "${OLDGW}" > /tmp/pptp_oldgw