root / pykota / trunk / bin / mailandpopup.sh @ 1258

Revision 1257, 1.1 kB (checked in by jalet, 21 years ago)

Copyright year changed.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1#! /bin/sh
2#
3# PyKota - Print Quotas for CUPS and LPRng
4#
5# (c) 2003-2004 Jerome Alet <alet@librelogiciel.com>
6# You're welcome to redistribute this software under the
7# terms of the GNU General Public Licence version 2.0
8# or, at your option, any higher version.
9#
10# You can read the complete GNU GPL in the file COPYING
11# which should come along with this software, or visit
12# the Free Software Foundation's WEB site http://www.fsf.org
13#
14# $Id$
15#
16# user's name
17UNAME=$1
18# printer's name
19PNAME=$2
20# message's recipient
21RECIPIENT=$3
22# message's body
23MESSAGE=$4
24#
25# Convert message body to UTF8 for WinPopup
26UTF8MESSAGE=`echo "$MESSAGE" | /usr/bin/iconv --to-code utf-8 --from-code iso-8859-15`
27#
28# Send original message to user
29/usr/bin/mail -s "Print Quota problem" $RECIPIENT <<EOF1
30$MESSAGE
31EOF1
32#
33# Send some information to root as well
34/usr/bin/mail -s "Print Quota problem on printer $PNAME" root <<EOF2
35Print Quota problem for user $UNAME
36EOF2
37#
38# Launch WinPopup on user's host (may need a real Samba or NT domain)
39echo "$UTF8MESSAGE" | /usr/bin/smbclient -M "$UNAME" 2>&1 >/dev/null
Note: See TracBrowser for help on using the browser.