Skip to content

Commit 3823763

Browse files
committed
tools/install.sh: added the '--safe' option that allows installation as root user (#573)
1 parent 1a99ee5 commit 3823763

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tools/install.sh

+12
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@
1919
# Script that installs Tizonia's debian packages and their dependencies.
2020
#
2121

22+
# Make sure the installation happens safely
23+
24+
if [[ "$(id -u)" -eq 0 ]]; then
25+
if [[ ( -z "$1" ) || ( "$1" != "--safe" ) ]]; then
26+
echo "WARNING: Running as root; installation aborted."
27+
echo "Please add '--safe' to bypass this check and continue installing as root."
28+
exit 1
29+
else
30+
echo "WARNING: Running as root with --safe option; installation continues..."
31+
fi
32+
fi
33+
2234
# Run the install actions in a subshell
2335
(
2436
RELIDS=$(cat /etc/*-release)

0 commit comments

Comments
 (0)