evenet/tinc-debug

23 lines
408 B
Bash
Executable File

#!/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