openvpn-event 666 B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/sh
  2. source /jffs/scripts/aiop/aiop-openvpn
  3. openvpn_run () {
  4. if [ ${1} -eq 6 ]; then
  5. unroute_vpn ${2} ${3}
  6. # Route is down, so we dont care about restarting dnsmasq
  7. elif [ ${1} -eq 5 ]; then
  8. route_vpn ${2} ${3}
  9. /jffs/scripts/dnsmasq.postconf ${2}
  10. fi
  11. }
  12. case "${1}" in
  13. tun11)
  14. openvpn_run $# "wl0.1" "${1}"
  15. openvpn_run $# "wl0.3" "${1}"
  16. ;;
  17. tun12)
  18. openvpn_run $# "wl0.2" "${1}"
  19. ;;
  20. tun13)
  21. openvpn_run $# "wl1.1" "${1}"
  22. ;;
  23. tun14)
  24. openvpn_run $# "wl1.2" "${1}"
  25. ;;
  26. tun15)
  27. openvpn_run $# "wl1.3" "${1}"
  28. ;;
  29. esac