# HG changeset patch # User Mikael Berthe # Date 1162746314 -3600 # Node ID 76c03fafabd35af5c02da8682026d061fe3bbde2 # Parent 9687ecc59303c3c89ee8fa5ad9db49f5064ae967 Make the sample event script more portable Thanks to Khalil Petit. diff -r 9687ecc59303 -r 76c03fafabd3 mcabber/contrib/eventcmd --- a/mcabber/contrib/eventcmd Sat Nov 04 22:06:37 2006 +0100 +++ b/mcabber/contrib/eventcmd Sun Nov 05 18:05:14 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