From 148d9fe0e109b7416410d8112a9ffd77ecb31a69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 26 Jan 2015 14:26:01 +0100 Subject: [PATCH] tinc-debug: only sudo if necessary --- tinc-update | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tinc-update b/tinc-update index 105dc68..a092b9e 100755 --- a/tinc-update +++ b/tinc-update @@ -17,17 +17,14 @@ else die "git not found. install git to use this script" fi -reload_tinc() { - echo "Reload tinc..." - sudo tinc -c . reload -} - if [[ $EUID -ne 0 ]]; then if has sudo; then - reload_tinc + echo "Reload tinc..." + sudo tinc -c . reload else die "run this script as root" fi else - reload_tinc + echo "Reload tinc..." + tinc -c . reload fi