From 6c9589373fa9001cde14835053724086e67df313 Mon Sep 17 00:00:00 2001 From: Yongzhi Pan Date: Thu, 22 Oct 2015 11:45:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=BE=E5=88=B0=E5=90=8E=E5=8F=B0=E6=8F=90?= =?UTF-8?q?=E9=AB=98=E8=BF=90=E8=A1=8C=E9=80=9F=E5=BA=A6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chnroutes.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/chnroutes.py b/chnroutes.py index 99401a6..c5da9f7 100755 --- a/chnroutes.py +++ b/chnroutes.py @@ -54,8 +54,8 @@ def generate_linux(metric): downfile.write('\n') for ip,mask,_ in results: - upfile.write('route add -net %s netmask %s gw $OLDGW\n'%(ip,mask)) - downfile.write('route del -net %s netmask %s\n'%(ip,mask)) + upfile.write('route add -net %s netmask %s gw $OLDGW &\n'%(ip,mask)) + downfile.write('route del -net %s netmask %s &\n'%(ip,mask)) downfile.write('rm /tmp/vpn_oldgw\n') @@ -107,8 +107,8 @@ def generate_mac(metric): downfile.write('\n') for ip,_,mask in results: - upfile.write('route add %s/%s "${OLDGW}"\n'%(ip,mask)) - downfile.write('route delete %s/%s ${OLDGW}\n'%(ip,mask)) + upfile.write('route add %s/%s "${OLDGW}" &\n'%(ip,mask)) + downfile.write('route delete %s/%s ${OLDGW} &\n'%(ip,mask)) downfile.write('\n\nrm /tmp/pptp_oldgw\n') upfile.close() @@ -181,8 +181,8 @@ def generate_android(metric): downfile.write('\n') for ip,mask,_ in results: - upfile.write('route add -net %s netmask %s gw $OLDGW\n'%(ip,mask)) - downfile.write('route del -net %s netmask %s\n'%(ip,mask)) + upfile.write('route add -net %s netmask %s gw $OLDGW &\n'%(ip,mask)) + downfile.write('route del -net %s netmask %s &\n'%(ip,mask)) upfile.close() downfile.close()