add tinc-debug script

This commit is contained in:
Jörg Thalheim 2015-01-26 14:26:18 +01:00
parent 148d9fe0e1
commit 5852ac2650

22
tinc-debug Executable file
View File

@ -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