tinc-debug: only sudo if necessary
This commit is contained in:
parent
a8bb6f609e
commit
148d9fe0e1
11
tinc-update
11
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
|
||||
|
Loading…
Reference in New Issue
Block a user