This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ipv6="$2" | |
start() { | |
echo -n "Starting Tunnels: " | |
echo "$ipv6" | awk '{print "/usr/bin/6tunnel 8080 "$1" 8080"}' | /bin/sh | |
echo "$ipv6" | awk '{print "/usr/bin/6tunnel 21 "$1" 21"}' | /bin/sh | |
echo "$ipv6" | awk '{print "/usr/bin/6tunnel 443 "$1" 443"}' | /bin/sh | |
return | |
} | |
stop() { | |
echo -n "Shutting down Tunnels: " | |
killall 6tunnel | |
return | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
restart) | |
stop | |
start | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Instead of
echo "$ipv6" | awk '{print "/usr/bin/6tunnel 8080 "$1" 8080"}' | /bin/sh
just write
/usr/bin/6tunnel 8080 "${ipv6}" 8080
.