From: Stephen Soltesz Date: Mon, 22 Jun 2009 19:51:09 +0000 (+0000) Subject: run certain scripts periodically X-Git-Tag: Monitor-3.0-18~25 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=3e5e0976e8bdc7b1cb4f7cde8da67641fbcec015;p=monitor.git run certain scripts periodically run certain scripts at startup use plcquery instead of getusersfromplc give 'priv' argument to adduserstort.pl --- diff --git a/rt3/adduserstort.pl b/rt3/adduserstort.pl index 899e4ce..91ff801 100644 --- a/rt3/adduserstort.pl +++ b/rt3/adduserstort.pl @@ -25,8 +25,13 @@ my $organization = ''; my $address1 = ''; my $city = ''; my $country = ''; +my $priv = 0; -print $ARGV[0]; +if ( $ARGV[0] == 'priv' ) +{ + shift @ARGV; + $priv = 1; +} open(USERS_DATA, $ARGV[0]) || die("Could not open file!"); @raw_data=; @@ -42,8 +47,8 @@ foreach $bc_user (@raw_data) RealName => $realname, EmailAddress => $email_address, Password => 'Passw0rd', - Organization => $organization, - Privileged => 0); + Organization => $organization, + Privileged => $priv); #Address1 => $address1, #City => $city, #Country => country, diff --git a/rt3/getusersfromplc.py b/rt3/getusersfromplc.py deleted file mode 100755 index da2c959..0000000 --- a/rt3/getusersfromplc.py +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/python - -from monitor.wrapper import plc - -api = plc.api - -sites = api.GetSites({'login_base' : 'princeton'}, ['person_ids', 'name']) -for s in sites: - persons = api.GetPersons(sites[0]['person_ids'], ['email' , 'first_name', 'last_name',]) - for p in persons: - print "%s,%s %s,%s" % (p['email'], p['first_name'], p['last_name'], s['name']) diff --git a/rt3/monitor-rt3.init b/rt3/monitor-rt3.init index ca94353..15c85cd 100644 --- a/rt3/monitor-rt3.init +++ b/rt3/monitor-rt3.init @@ -122,24 +122,18 @@ function check_rt_init () { if [ ! -f /etc/rt3/setup.finished ] ; then /usr/sbin/rt-setup-database --action init --dba postgres - for f in $MONITORPATH/rt3/rtinit.d/*.pl ; do + for f in $MONITORPATH/rt3/rtconf.d/*.pl ; do /usr/sbin/rt-setup-database --action insert --dba postgres --datafile $f done - touch /etc/rt3/setup.finished - ###Last DB adjustments - #setup custom field values - cat <