For network notifications, you need to use a password, which must be salted and hashed in a particular way. Additionally, the computer that will be sending notifications must also have first sent registration command with one or more notification types defined.
To do the password salting/hashing, you'd do something like this:
# Hexify the salt:
HEXSALT=`echo -n $SALT | xxd -p`
# Md5 the password+salt
KEYBASIS=`echo -n "$PASSWORD$SALT" | $MD5SUM`
KEYBASIS=${KEYBASIS:0:32}
KEY=`echo -n "$KEYBASIS" | xxd -r -p | $MD5SUM`
KEY=${KEY:0:32}
Note that the salt can be completely arbitrary (and can change, message to message), as long as it's at least 4 characters in size. Then, you build the registration message:
# Now we need to build the message string.
MESSAGE="GNTP/1.0 REGISTER NONE MD5:$KEY.$HEXSALT
Application-Name: My Application
Application-Icon: http://somesite.come/whatever.png
Notifications-Count: 2
Notification-Name: startup
Notification-Display-Name: Starting
Notification-Enabled: False
Notification-Name: downtime
Notification-Display-Name: Shutting Down
Notification-Enabled: True
"
MESSAGE=`echo -ne "$MESSAGE" | $UNIX2DOS`
echo "$MESSAGE"
In theory the icon can be sent in the message, I've never managed to get it to work. Icons should be at least 64x64 or they look weird in Growl for Windows, I've not checked with Growl for Mac or Apple's Notification Center. Then to send the message, something like:
echo "$MESSAGE" | nc -v $ipaddress 23053
Though you could probably eliminate netcat entirely and use bash's TCP facilities (/dev/tcp)... I just have never used that before, don't know how. Finally, to send a notice, you'd do this:
MESSAGE="GNTP/1.0 NOTIFY NONE MD5:$KEY.$HEXSALT
Application-Name: $APPLICATION
Notification-Name: $NAME
Notification-Title: $TITLE
Notification-Text: $TEXT
Notification-Sticky: $STICKY
Notification-Priority: $PRIORITY
"
MESSAGE=`echo -ne "$MESSAGE" | $UNIX2DOS`
echo "$MESSAGE"
App-name and Not-name have to match what was send in registration. Priority has to be between -2 and 2. "Sticky" is True/False.