#!/usr/bin/perl # missa v.0.1 # copyright (c) 2000 by Jaume Teixi # You are free to distribute this software under # the terms of the GNU General Public License. # External vars are: Email, Webmaster and Servername $Serveruser = 'estadistiques'; $Serverpass = 'mensuals2000'; $sendmailpath = '/usr/lib/sendmail'; &mkdate; &mkemail; sub mkdate { # Define day of week and months @days = ('Diumenge','Dilluns','Dimarts','Dimecres', 'Dijous','Divendres','Dissabte'); @months = ('Gener','Febrer','Mar\xe7','Abril','Maig','Juny','Juliol', 'Agost','Setembre','Octubre','Novembre','Desembre'); # Get system date and format it ($sec,$min,$hour,$mday,$mon,$year,$wday) = (localtime(time))[0,1,2,3,4,5,6]; $time = sprintf("%02d:%02d:%02d",$hour,$min,$sec); $year += 1900; # Format Date string with current month because we still are on last day $Date = "$days[$wday] $mday-$months[$mon]-$year $time h."; } sub mkemail { open(emaildata,"|$sendmailpath -t"); print emaildata "To: $Email,$Webmaster\n"; print emaildata "From: $Webmaster\n"; print emaildata "Subject: Estad\xedstiques $months[$mon]-$year de $Servername\n\n"; print emaildata "Ens plau anunciar-li que s'han generat les estad\xedstiques mensuals"; print emaildata " de $Servername\n\n"; print emaildata "Pot consultar-les ara mateix a l'adre\xe7a\n"; print emaildata "http://www.$Servername/stats\n"; print emaildata "Introdu\xefnt Usuari: $Serveruser Contrassenya: $Serverpass \n"; print emaildata "\nTrobar\xe0 el manual de consulta en l'adre\xe7a\n"; print emaildata "http://www.6tems.com/clients/estadistiques.html\n\n\n"; print emaildata "Cordialment,\n6TEMS - Ducform, SA\nhttp://www.6tems.com\n"; close (emaildata); }