#!/bin/bash # Another useless script by fm_scripts at noinfo.de # http://www.noinfo.de/skripte/ # # # If you have trouble using it, try "wget http://noinfo.de/skripte/winmsg" # to download the script # # Parameters are corresponding to the call in /etc/smb.conf, # in the "message command = " - section # $1 = %f $2 = %t $3 = %s TIMESTAMP=`date +%D-%k:%M:%S` MESSAGE_FILE=/downloads/smb_messages.txt echo " Client $1 sent the above message to $2 at $TIMESTAMP" >> $3 # If you want to forward the message to computer "nodens" cat $3 |smbclient -M nodens # If you want to message all users logged to your local machine: cat $3 |wall # If you want to message only user "root" on your local machine, if he is # logged in... (UNTESTED!) #cat $3 |write root # If you want to write all incoming messages into $MESSAGE_FILE # Remember to set the file-access rights for this file so that anyone may # write it, otherwise the script (run by nobody IIRC) won't be allowed to # write the messages into it... cat $3 >> $MESSAGE_FILE echo "-------------------------------------------------------------------" >> $MESSAGE_FILE # cleanup... rm $3 exit 0