diff options
| author | nl6720 <nl6720@gmail.com> | 2020-10-01 17:02:11 +0300 |
|---|---|---|
| committer | nl6720 <nl6720@gmail.com> | 2020-10-04 11:31:14 +0300 |
| commit | b6241cb1d07fe38128a67ae73e1ee57085085eaf (patch) | |
| tree | 1c10e1a079f1c6c1a3aead41b39448cc7643a250 | |
| parent | 55cfb8ba021266d754eb21fb22c666f9f7a49442 (diff) | |
| download | archiso-b6241cb1d07fe38128a67ae73e1ee57085085eaf.tar.gz archiso-b6241cb1d07fe38128a67ae73e1ee57085085eaf.tar.bz2 | |
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 | archiso/mkarchiso | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/archiso/mkarchiso b/archiso/mkarchiso index ed932d9..9e96f5e 100755 --- a/archiso/mkarchiso +++ b/archiso/mkarchiso @@ -827,16 +827,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 |
