mirror of
https://github.com/itdoginfo/ansible-openwrt-hirkn.git
synced 2025-12-14 02:54:29 +05:00
Fix hotplug
This commit is contained in:
@@ -9,25 +9,27 @@ check_repo() {
|
|||||||
|
|
||||||
route_vpn () {
|
route_vpn () {
|
||||||
if [ "$TUNNEL" == wg ]; then
|
if [ "$TUNNEL" == wg ]; then
|
||||||
cat << EOF > /etc/hotplug.d/net/30-vpnroute
|
cat << EOF > /etc/hotplug.d/iface/30-vpnroute
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
ip route add table vpn default dev wg0
|
ip route add table vpn default dev wg0
|
||||||
EOF
|
EOF
|
||||||
elif [ "$TUNNEL" == awg ]; then
|
elif [ "$TUNNEL" == awg ]; then
|
||||||
cat << EOF > /etc/hotplug.d/net/30-vpnroute
|
cat << EOF > /etc/hotplug.d/iface/30-vpnroute
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
ip route add table vpn default dev awg0
|
ip route add table vpn default dev awg0
|
||||||
EOF
|
EOF
|
||||||
elif [ "$TUNNEL" == singbox ] || [ "$TUNNEL" == ovpn ] || [ "$TUNNEL" == tun2socks ]; then
|
elif [ "$TUNNEL" == singbox ] || [ "$TUNNEL" == ovpn ] || [ "$TUNNEL" == tun2socks ]; then
|
||||||
cat << EOF > /etc/hotplug.d/net/30-vpnroute
|
cat << EOF > /etc/hotplug.d/iface/30-vpnroute
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
sleep 10
|
sleep 10
|
||||||
ip route add table vpn default dev tun0
|
ip route add table vpn default dev tun0
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
cp /etc/hotplug.d/iface/30-vpnroute /etc/hotplug.d/net/30-vpnroute
|
||||||
}
|
}
|
||||||
|
|
||||||
add_mark() {
|
add_mark() {
|
||||||
|
|||||||
Reference in New Issue
Block a user