RT#18834: Cacti integration [added graph generation]
[freeside.git] / bin / agent_email
1 #!/usr/bin/perl
2
3 use strict;
4 use Getopt::Std;
5 use FS::UID qw(adminsuidsetup);
6
7 &untaint_argv;  #what it sounds like  (eww)
8 use vars qw(%opt);
9 getopts("a:", \%opt);
10
11 my $user = shift or die &usage;
12 adminsuidsetup $user;
13
14 use FS::Cron::agent_email qw(agent_email);
15 agent_email(%opt);
16
17 ###
18 # subroutines
19 ###
20
21 sub untaint_argv {
22   foreach $_ ( $[ .. $#ARGV ) { #untaint @ARGV
23     #$ARGV[$_] =~ /^([\w\-\/]*)$/ || die "Illegal arguement \"$ARGV[$_]\"";
24     # Date::Parse
25     $ARGV[$_] =~ /^(.*)$/ || die "Illegal arguement \"$ARGV[$_]\"";
26     $ARGV[$_]=$1;
27   }
28 }
29
30 1;