edge513 / autoddvpn

Automatically exported from code.google.com/p/autoddvpn
0 stars 0 forks source link

Patch for /trunk/bin/pptp/run.sh #173

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
如果PPTP服務未開啓,那麼12次後IPUP仍然不會被更改,這種情�
��下就不應該繼續執行下去,而是應該終止讓用戶檢查是否開
啓了PPTP服務。根據此做出修改。
修改部分:
在DEBUG="[DEBUG#${PID}]"行後,IPUP="/tmp/pptpd_client/ip-up"行前增加:
ERROR="[ERROR#${PID}]"
(line 12)
循環後面的代碼修改為:

if [ -e $IPUP ]; then
  echo "$INFO $(date "+%d/%b/%Y:%H:%M:%S") modifying $IPDOWN" >> $VPNLOG
  if [ -e $IPDOWN ]; then
     sed -ie 's#exit 0#/usr/local/bin/vpndown.sh pptp\nexit 0#g' $IPDOWN
     echo "$INFO $(date "+%d/%b/%Y:%H:%M:%S") $IPDOWN modified" >> $VPNLOG
     echo "$INFO $(date "+%d/%b/%Y:%H:%M:%S") ALL DONE. Let's wait for VPN being connected." >> $VPNLOG
  else
     echo "$IPDOWN not exists" >> $VPNLOG
  fi  
else
  echo "$ERROR $(date "+%d/%b/%Y:%H:%M:%S") $IPUP still not exists, check if pptp service is opened." >> $VPNLOG
fi
(line 34-45)

Original issue reported on code.google.com by i@blue.cat on 15 Nov 2012 at 6:39

Attachments: