prompt for root password
If I may recommend:
if ! [ "$USER" = 'root' ]; then
\\echo 'enter root password'
/bin/su --command "$0"
else
# (code)
fi
Note thatsudo
may be more appropriate than/bin/su
, but a user may not have access to it.
-
changed the description
-
Thanks for your contribution. However it is more simple return with error and allow the user use sudo or su. I have already implemented the change. I will commit as soon as possible.
if ! [ "$USER" = 'root' ]; then printf "%s\ " "Run $0 as root" exit $EXIT_NO_ROOT fi
-
closed