check if running as root
This commit is contained in:
Regular → Executable
+6
@@ -140,6 +140,12 @@ for dependency in ${DEPENDENCIES}; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Check if running as root
|
||||||
|
if [ "$(id -u)" -ne 0 ]; then
|
||||||
|
echo "Please run as root. Exiting ..."
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
# Check script arguments
|
# Check script arguments
|
||||||
if [ $# -ne 1 ]; then
|
if [ $# -ne 1 ]; then
|
||||||
echo "Error: not enough arguments!"
|
echo "Error: not enough arguments!"
|
||||||
|
|||||||
Reference in New Issue
Block a user