summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-08-21 18:45:10 -0700
committerIvan Kohler <ivan@freeside.biz>2012-08-21 18:45:10 -0700
commit0f54bc9de62911521dec0d6d418703a7af8033f6 (patch)
tree875799d9ed5b09bcd1453219c7f9882d69364228 /bin
parent4e231b1386471a26c37e4d4d4ef236de66fd7e3a (diff)
add agent email, RT#18231
Diffstat (limited to 'bin')
-rwxr-xr-xbin/agent_email30
1 files changed, 30 insertions, 0 deletions
diff --git a/bin/agent_email b/bin/agent_email
new file mode 100755
index 000000000..2fe47c4ba
--- /dev/null
+++ b/bin/agent_email
@@ -0,0 +1,30 @@
+#!/usr/bin/perl
+
+use strict;
+use Getopt::Std;
+use FS::UID qw(adminsuidsetup);
+
+&untaint_argv; #what it sounds like (eww)
+use vars qw(%opt);
+getopts("a:", \%opt);
+
+my $user = shift or die &usage;
+adminsuidsetup $user;
+
+use FS::Cron::agent_email qw(agent_email);
+agent_email(%opt);
+
+###
+# subroutines
+###
+
+sub untaint_argv {
+ foreach $_ ( $[ .. $#ARGV ) { #untaint @ARGV
+ #$ARGV[$_] =~ /^([\w\-\/]*)$/ || die "Illegal arguement \"$ARGV[$_]\"";
+ # Date::Parse
+ $ARGV[$_] =~ /^(.*)$/ || die "Illegal arguement \"$ARGV[$_]\"";
+ $ARGV[$_]=$1;
+ }
+}
+
+1;