Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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
@derFunk

This comment has been minimized.

Copy link

commented Jun 25, 2018

Instead of
echo "$ipv6" | awk '{print "/usr/bin/6tunnel 8080 "$1" 8080"}' | /bin/sh
just write
/usr/bin/6tunnel 8080 "${ipv6}" 8080.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.