Advertisement
Guest User

Untitled

a guest
Aug 19th, 2015
178
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. if [ ! -f /cache/usb_tether_prevconfig ] ; then
  4. echo '/cache/usb_tether_prevconfig not found. Is tethering really active?' >&2
  5. exit 1
  6. fi
  7.  
  8. if [ -f /cache/usb_tether_dnsmasq.pid ] ; then
  9. kill "$(cat /cache/usb_tether_dnsmasq.pid)"
  10. rm /cache/usb_tether_dnsmasq.pid
  11. fi
  12.  
  13.  
  14.  
  15.  
  16. echo 0 > /proc/sys/net/ipv4/ip_forward
  17. #echo 0 > /proc/sys/net/ipv6/conf/forwarding
  18. #echo 0 > /proc/sys/net/ipv6/conf/forwarding
  19.  
  20. #delete rules
  21. #ip6tables -D FORWARD -i usb0
  22. #ip6tables -t nat -D POSTROUTING 1
  23. iptables -D FORWARD -i usb0
  24. iptables -t nat -D POSTROUTING 1
  25.  
  26. #shut down dev
  27. #ip link set usb0 down
  28. #ip addr flush dev usb0
  29. #ip rule del from all lookup main
  30.  
  31.  
  32. #setprop sys.usb.config "$(cat /cache/usb_tether_prevconfig)"
  33. setprop sys.usb.config "mtp,adb"
  34. rm /cache/usb_tether_prevconfig
  35.  
  36. #usb0 dev down
  37. android-gadget-service enable mtp
  38. sleep 4
  39. while [ "$(getprop sys.usb.state)" = 'rndis,adb' ] ; do sleep 1 ; done
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement