diff --git a/tinc-debug b/tinc-debug new file mode 100755 index 0000000..a4ee38a --- /dev/null +++ b/tinc-debug @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +set -eu + +if [ -z "$BASH" ]; then + echo "All vpn scripts requires bash!" + exit 1 +fi + +DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) + +if [[ $EUID -ne 0 ]]; then + if has sudo; then + echo "Start tinc. Cancel with Ctrl+C ..." + sudo tincd -c "$DIR" -D -d + else + die "run this script as root" + fi +else + echo "Start tinc. Cancel with Ctrl+C ..." + tincd -c "$DIR" -D -d +fi