| 1 | #!/data/data/com.termux/files/usr/bin/sh |
| 2 | set -e -u |
| 3 | |
| 4 | SCRIPTNAME=termux-notification-remove |
| 5 | show_usage () { |
| 6 | echo "Usage: $SCRIPTNAME notification-id" |
| 7 | echo "Remove a notification previously shown with termux-notification --id." |
| 8 | exit 0 |
| 9 | } |
| 10 | |
| 11 | while getopts :h option |
| 12 | do |
| 13 | case "$option" in |
| 14 | h) show_usage;; |
| 15 | ?) echo "$SCRIPTNAME: illegal option -$OPTARG"; exit 1; |
| 16 | esac |
| 17 | done |
| 18 | shift $(($OPTIND-1)) |
| 19 | |
| 20 | if [ $# != 1 ]; then echo "$SCRIPTNAME: no notification id specified"; exit 1; fi |
| 21 | |
| 22 | /data/data/com.termux/files/usr/libexec/termux-api NotificationRemove --es id $1 |