check running as root

This commit is contained in:
Asif Bacchus 2019-07-26 03:14:12 -06:00
parent efe202d9a3
commit dd49378678
1 changed files with 5 additions and 0 deletions

View File

@ -388,6 +388,11 @@ done
### check pre-requisites and default values
# check if running as root, otherwise exit
if [ $( id -u ) -ne 0 ]; then
printf "\n${err}ERROR: script MUST be run as ROOT${norm}\n\n"
exit 2
fi
# does the details file exist?
if [ ! -f "$configDetails" ]; then
badParam dne "(--details default)" "$configDetails"