Sei sulla pagina 1di 2

// OnStop script $LogD OnStop script $LogD $LogD $LogD $LogD wifi or 3g card adress : "$oldAdress" Interface to use

: "$myInterface" Old route adress disabled : "$defaultRoute" default route to restore : "$firstdefaultroute"

$LogD adress to use : "$myIp" $LogD nativeUdp : "$nativeUdp" // INTERFACE //-------------------------// reset interface ip (delete default gateway) if $myInterface = tun0 $LogD interface is tun0. don't shutdown interface else $LogD busybox ifconfig $myInterface down $busybox ifconfig $myInterface down //$busybox ifconfig $myInterface 0.0.0.0 up fi // ROUTE : revert to old route //-------------------------------------//$busybox route add default gateway "$firstdefaultroute" if "$firstdefaultroute" = "" then $LogD no default route to restore else // route add default gateway ip interface $LogD route add default gateway $firstdefaultroute $busybox route add default gateway $firstdefaultroute if $lastResultSuccess = false then $LogE route add default gateway $firstdefaultroute : nok $LogE lastResultStdErr : "$lastResultStdErr" else $LogD restore default gateway : OK fi fi //$busybox ifconfig $myInterface down // reset IPTABLES //------------------------//$iptables -D INPUT -p icmp -j LOG --log-uid --log-level debug --log -prefix "MYPREROUTING " --log-ip-options //$iptables -D OUTPUT -p icmp -j LOG --log-uid --log-level debug --log-p refix "MYPREROUTING " --log-ip-options //$iptables -t nat -D INPUT -p icmp -j LOG --log-uid --log-level debug --logprefix "MYPREROUTING " --log-ip-options //$iptables -t nat -D OUTPUT -p icmp -j LOG --log-uid --log-level debug --log-pr efix "MYPREROUTING " --log-ip-options //$iptables -t nat -D TETHER -p icmp -j LOG --log-uid --log-level debug --log-p refix "MYPREROUTING " --log-ip-options $LogI clean iptables

$iptables $iptables $iptables $iptables $iptables $iptables

-t -t -t -t -F -t

nat -D OUTPUT -j TETHER nat -F TETHER nat -F filter -F nat --delete-chain TETHER