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"
|
die "git not found. install git to use this script"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
reload_tinc() {
|
|
||||||
echo "Reload tinc..."
|
|
||||||
sudo tinc -c . reload
|
|
||||||
}
|
|
||||||
|
|
||||||
if [[ $EUID -ne 0 ]]; then
|
if [[ $EUID -ne 0 ]]; then
|
||||||
if has sudo; then
|
if has sudo; then
|
||||||
reload_tinc
|
echo "Reload tinc..."
|
||||||
|
sudo tinc -c . reload
|
||||||
else
|
else
|
||||||
die "run this script as root"
|
die "run this script as root"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
reload_tinc
|
echo "Reload tinc..."
|
||||||
|
tinc -c . reload
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user