Skip to content

Commit

Permalink
Improved checking for and error reporting for the script running in t…
Browse files Browse the repository at this point in the history
…he CLI even more.
  • Loading branch information
Mirdarthos committed Dec 13, 2024
1 parent d254235 commit baf92e8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/usr/bin/mumuh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
# Ensure the script is run in the CLI
if [[ ! "${SHLVL}" -gt "1" ]];
then
if command -v notify-send 1> /dev/null 2> /dev/null;
if command -v kdialog 1> /dev/null 2> /dev/null;
then
notify-send --icon=emblem-error --urgency=critical --wait --action="OK" --app-name="MUMUH" "Script has to be run from the command line. Cannot continue."
kdialog --title "MUMUH" --icon "error" --msgbox "Script has to be run from the command line. Cannot continue."
elif command -v notify-send 1> /dev/null 2> /dev/null;
then
notify-send --icon=error --urgency=critical --wait --action="OK" --app-name="MUMUH" "Script has to be run from the command line. Cannot continue."
fi
exit 19
fi
Expand Down Expand Up @@ -177,11 +180,11 @@ then
shift
;;
--version)
printf '%s\n' "${TEXTFORMATTING[BRIGHT]}Current version:${TEXTFORMATTING[NORMAL]} 8.4"
printf '%s\n' "${TEXTFORMATTING[BRIGHT]}Current version:${TEXTFORMATTING[NORMAL]} 9"
exit
;;
-v)
printf '%s\n' "8.4"
printf '%s\n' "9"
exit
;;
--custombackupcommand=*|-c)
Expand Down

0 comments on commit baf92e8

Please sign in to comment.