Browse Source

Add support for channels

Alois Mahdal 4 years ago
parent
commit
8cb014ec81
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      bin/notifirc

+ 6
- 0
bin/notifirc View File

12
         echo "usage: $self [options] [-l max_lines] [-L max_width] -f message_file|-"
12
         echo "usage: $self [options] [-l max_lines] [-L max_width] -f message_file|-"
13
         echo "options: [-h host] [-p port] [-n nick] [-c context] [-u user]"
13
         echo "options: [-h host] [-p port] [-n nick] [-c context] [-u user]"
14
         echo ""
14
         echo ""
15
+        echo "user can be user name but also channel name, in that case notifirc"
16
+        echo "will JOIN the channel first."
17
+        echo ""
15
         echo "Defaults for options can be defined as POSIX shell assignments under"
18
         echo "Defaults for options can be defined as POSIX shell assignments under"
16
         echo "/etc/notifirc.rc or ~/.notifirc.rc. (E.g. 'nick=jdoe', 'max_width=40')."
19
         echo "/etc/notifirc.rc or ~/.notifirc.rc. (E.g. 'nick=jdoe', 'max_width=40')."
17
         echo ""
20
         echo ""
30
     local message
33
     local message
31
     echo "NICK $nick"
34
     echo "NICK $nick"
32
     echo "USER $nick 8 * :notifirc bot"
35
     echo "USER $nick 8 * :notifirc bot"
36
+    if test "${user:0:1}" == '#'; then
37
+        echo "JOIN $user"
38
+    fi
33
     while read -r message;
39
     while read -r message;
34
     do
40
     do
35
         echo "PRIVMSG $user :$message"
41
         echo "PRIVMSG $user :$message"