diff options
author | nl6720 <nl6720@gmail.com> | 2020-10-01 17:02:11 +0300 |
---|---|---|
committer | David P <megver83@parabola.nu> | 2020-10-06 13:23:57 -0300 |
commit | b02fee099f2d13442fc93088f63aa3ef47d12117 (patch) | |
tree | d04691fc7663f876d144bce406a5c468e11fd91b | |
parent | dc7a7f8e2c77aee8e1404e05a30cbfd6e18d5a94 (diff) |
Don't require root privileges just to show a "No command specified" error
Check if a profile or command is specified before looking at EUID.
-rwxr-xr-x | parabolaiso/mkparabolaiso | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/parabolaiso/mkparabolaiso b/parabolaiso/mkparabolaiso index 719d703..895c35e 100755 --- a/parabolaiso/mkparabolaiso +++ b/parabolaiso/mkparabolaiso @@ -933,16 +933,16 @@ while getopts 'p:r:C:L:P:A:D:w:o:s:c:g:vh?' arg; do esac done +if (( OPTIND <= 1 )); then + _msg_error "No command specified" 0 + _usage 1 +fi + if (( EUID != 0 )); then _msg_error "${app_name} must be run as root." 1 fi shift $((OPTIND - 1)) - -if (( $# < 1 )); then - _msg_error "No command specified" 0 - _usage 1 -fi command_name="${1}" # Set directory path defaults for legacy commands |