Subversion Repositories camp_sysinfo_client_3

Rev

Rev 117 | Rev 153 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 117 Rev 152
Line 6... Line 6...
6
# changed cleanup to remove encapsulating quotes
6
# changed cleanup to remove encapsulating quotes
7
 
7
 
8
# Description: Library used by modules. Do NOT enable
8
# Description: Library used by modules. Do NOT enable
9
 
9
 
10
 
10
 
11
our $VERSION = '1.3';
11
our $VERSION = '1.4';
12
 
12
 
13
# set of libraries to be used by these modules
13
# set of libraries to be used by these modules
14
 
14
 
15
 
15
 
16
# cleanUp - passed a delimiter and a string, does the following (delimiter can be '')
16
# cleanUp - passed a delimiter and a string, does the following (delimiter can be '')
Line 55... Line 55...
55
   chomp $result;
55
   chomp $result;
56
   $result =~ s/$parameter:\s*//;
56
   $result =~ s/$parameter:\s*//;
57
   return $result;
57
   return $result;
58
}
58
}
59
 
59
 
-
 
60
# simple function to return true if the current date is the first of the week, month or year
-
 
61
# parameter passed in is 'w' (weekly), 'm' (monthly) or 'y' (yearly)
-
 
62
# to have a test run only weekly, place
-
 
63
# exit 1 unless &checkDate( 'w' );
-
 
64
sub checkDate {
-
 
65
   my $frequency = lc shift;
-
 
66
   my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
-
 
67
   return $mday == 1 if $frequency eq 'm'; # monthly
-
 
68
   return $wday == 1 if $frequency eq 'w'; # weekly
-
 
69
   return $yday == 1 if $frequency eq 'y'; # yearly
-
 
70
   return 0; # we failed
-
 
71
}
-
 
72
      
-
 
73
 
60
1;
74
1;