From 5852ac2650450b57242f7d4325e36d903b62b419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 26 Jan 2015 14:26:18 +0100 Subject: [PATCH] add tinc-debug script --- tinc-debug | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 tinc-debug 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