Add tool/DumpSelectable
[platform/upstream/libzypp.git] / tools / notify-message
1 #! /bin/bash
2 ######################################################################
3 test "$1" = "--help" && {
4 cat <<EOF
5 Usage: notify-message [-p PACKAGE]
6
7 Per default zypp invokes this command to propagate update
8 notification messages. The optional -p argument should
9 denote the packages that causes this message to be sent.
10 The message text itself is read from stdin.
11
12 See update.messages.notify option in /etc/zypp.conf
13 for details.
14 EOF
15 exit 0;
16 }
17 ######################################################################
18
19 MAILCMD="/usr/bin/mail"
20 test -x "$MAILCMD" || {
21         echo "notify-message: $MAILCMD: command not found" >&2
22         exit 1;
23 }
24
25 MAILTAG="[zypp-notify-message]"
26 MAIL_TO="root"
27 # curently just '-p packageident'
28 test "$1" = "-p" && {
29         MAILTAG="$MAILTAG $2"
30 }
31
32 exec $MAILCMD -s "$MAILTAG" $MAIL_TO