mirror of
https://github.com/danog/termux-api-package.git
synced 2024-11-30 04:39:01 +01:00
notification: do not allow empty id with --ongoing
Ongoing notifications can only be removed with termux-notification-remove, which requires the notification id. An ongoing notification without an id requires a reboot to be removed. This commit forbids creating such an "unremovable" notification.
This commit is contained in:
parent
0b1845fe5d
commit
3f68215d12
6
scripts/termux-notification
Normal file → Executable file
6
scripts/termux-notification
Normal file → Executable file
@ -114,6 +114,12 @@ done
|
||||
|
||||
if [ $# != 0 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi
|
||||
|
||||
if [ "$OPT_ONGOING" == true ] && [ -z "$OPT_ID" ]; then
|
||||
echo "Ongoing notifications without an ID are not removable."
|
||||
echo "Please set an id with --id \"string\"."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
set --
|
||||
if [ -n "$OPT_ACTION" ]; then set -- "$@" --es action "$OPT_ACTION"; fi
|
||||
if [ -n "$OPT_ALERT_ONCE" ]; then set -- "$@" --ez alert-once "$OPT_ALERT_ONCE"; fi
|
||||
|
Loading…
Reference in New Issue
Block a user