shfmt tunsocks.sh
This commit is contained in:
parent
2b1095760f
commit
ba4bbfa18c
@ -15,8 +15,7 @@ else
|
|||||||
proxy="socks5:///run/nnss-${nsname}/sock"
|
proxy="socks5:///run/nnss-${nsname}/sock"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
setup()
|
setup() {
|
||||||
{
|
|
||||||
ip tuntap add mode tun dev "$device"
|
ip tuntap add mode tun dev "$device"
|
||||||
|
|
||||||
/usr/bin/tun2socks -device "$device" -proxy "$proxy" &
|
/usr/bin/tun2socks -device "$device" -proxy "$proxy" &
|
||||||
@ -34,8 +33,7 @@ setup()
|
|||||||
wait
|
wait
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup()
|
cleanup() {
|
||||||
{
|
|
||||||
ip tuntap del mode tun dev "$device" || true
|
ip tuntap del mode tun dev "$device" || true
|
||||||
kill "$(cat "$pidfile")"
|
kill "$(cat "$pidfile")"
|
||||||
ip -n "$ns" tuntap del mode tun dev "$device"
|
ip -n "$ns" tuntap del mode tun dev "$device"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user