-----/etc/hotplug.d/iface/30-openvpn-----
#!/bin/sh
[ "$ACTION" = "ifup" -a "$INTERFACE" = "wan" ] &&
[ -z "`/sbin/ifconfig tun0 2>&1 | grep inet`" ] && {
/etc/init.d/openvpn start
}
[ "$ACTION" = "ifdown" -a "$INTERFACE" = "wan" ] &&
[ -n "`/sbin/ifconfig tun0 2>&1 | grep inet`" ] && {
/etc/init.d/openvpn stop
}
-----end files-----
好了,你重启外网连接的时候,就会自动连接openvpn。
参考:
OpenWRT下的动态DNS(用3322.org的服务)
没有评论:
发表评论