From 5ca41f8b4f70dbe45d14c74349657a60f0b6bbde Mon Sep 17 00:00:00 2001 From: gnhb Date: Sun, 28 Mar 2010 22:04:13 +0700 Subject: [PATCH] Don't need the rm -f statement when using > redirect to overwrite the file, and add the "then" to the if statements --- usr/local/sbin/ppp-linkup | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/usr/local/sbin/ppp-linkup b/usr/local/sbin/ppp-linkup index a17b3d8702..f15f0824b5 100755 --- a/usr/local/sbin/ppp-linkup +++ b/usr/local/sbin/ppp-linkup @@ -1,7 +1,5 @@ #!/bin/sh -/bin/rm -f /var/etc/nameserver_$1 - # unset CGI environment variables so as not to confuse PHP unset CONTENT_TYPE GATEWAY_INTERFACE REMOTE_USER REMOTE_ADDR AUTH_TYPE unset HTTP_USER_AGENT CONTENT_LENGTH SCRIPT_FILENAME HTTP_HOST @@ -9,12 +7,12 @@ unset SERVER_SOFTWARE HTTP_REFERER SERVER_PROTOCOL REQUEST_METHOD unset SERVER_PORT SCRIPT_NAME SERVER_NAME # write nameservers to file -if [ "$6" = "dns1" ] +if [ $6 = "dns1" ]; then echo $7 > /var/etc/nameserver_$1 /sbin/route add $7 $4 fi -if [ "$8" = "dns2" ] +if [ $8 = "dns2" ]; then echo $9 >> /var/etc/nameserver_$1 /sbin/route add $9 $4 fi