# HG changeset patch # User Mikael Berthe # Date 1163701812 -3600 # Node ID 1d35e297a8c4598cc86f7e3d377c69f481452eb7 # Parent 8569e353530597641a55a397a070bb823c89e15d [BP-76c03fafabd3] Make the sample event script more portable diff -r 8569e3535305 -r 1d35e297a8c4 mcabber/contrib/eventcmd --- a/mcabber/contrib/eventcmd Thu Nov 16 19:30:12 2006 +0100 +++ b/mcabber/contrib/eventcmd Thu Nov 16 19:30:12 2006 +0100 @@ -19,19 +19,19 @@ # Note that the 4th argument is only provided for incoming messages # and when 'event_log_files' is set. -if [ $event == "MSG" ]; then +if [ $event = "MSG" ]; then case "$arg1" in IN) # Incoming message from buddy $arg2 $CMD_MSG_IN > /dev/null 2>&1 - if [[ -n "$filename" && -f "$filename" ]]; then + if [ -n "$filename" -a -f "$filename" ]; then # We could process filename here... /bin/rm $filename fi ;; MUC) # Groupchat message in room $arg2 - if [[ -n "$filename" && -f "$filename" ]]; then + if [ -n "$filename" && -f "$filename" ]; then # We could process filename here... /bin/rm $filename fi @@ -40,7 +40,7 @@ # Outgoing message for buddy $arg2 ;; esac -elif [ $event == "STATUS" ]; then +elif [ $event = "STATUS" ]; then # Buddy $arg2 status is $arg1 (_, O, I, F, D, N, A) echo > /dev/null fi