comparison mcabber/contrib/events/eventcmd @ 2169:4889f429fdd0

Get read of bashism in contrib/events/eventcmd.pastebin thanks to Raphael Geissert, see Debian BTS issue ##772307.
author Mikael Berthe <mikael@lilotux.net>
date Sun, 15 Feb 2015 12:12:22 +0100
parents cca19ce862ef
children
comparison
equal deleted inserted replaced
2168:87244845fd9c 2169:4889f429fdd0
17 arg2=$3 17 arg2=$3
18 filename=$4 18 filename=$4
19 # Note that the 4th argument is only provided for incoming messages 19 # Note that the 4th argument is only provided for incoming messages
20 # and when 'event_log_files' is set. 20 # and when 'event_log_files' is set.
21 21
22 if [ $event = "MSG" ]; then 22 if [ "$event" = "MSG" ]; then
23 case "$arg1" in 23 case "$arg1" in
24 IN) 24 IN)
25 # Incoming message from buddy $arg2 25 # Incoming message from buddy $arg2
26 $CMD_MSG_IN > /dev/null 2>&1 26 $CMD_MSG_IN > /dev/null 2>&1
27 if [ -n "$filename" -a -f "$filename" ]; then 27 if [ -n "$filename" -a -f "$filename" ]; then
38 ;; 38 ;;
39 OUT) 39 OUT)
40 # Outgoing message for buddy $arg2 40 # Outgoing message for buddy $arg2
41 ;; 41 ;;
42 esac 42 esac
43 elif [ $event = "STATUS" ]; then 43 elif [ "$event" = "STATUS" ]; then
44 # Buddy $arg2 status is $arg1 (_, O, I, F, D, N, A) 44 # Buddy $arg2 status is $arg1 (_, O, I, F, D, N, A)
45 echo > /dev/null 45 echo > /dev/null
46 elif [ $event = "UNREAD" ]; then 46 elif [ "$event" = "UNREAD" ]; then
47 # $arg1 contains 4 numbers separated with space chars: 47 # $arg1 contains 4 numbers separated with space chars:
48 # Nr of unread buffers, nr of unread buffers with attention sign, 48 # Nr of unread buffers, nr of unread buffers with attention sign,
49 # nr of MUC unread buffers, nr of MUC unread buffers with attention sign. 49 # nr of MUC unread buffers, nr of MUC unread buffers with attention sign.
50 echo > /dev/null 50 echo > /dev/null
51 fi 51 fi