Loading cron.pl +6 −12 Original line number Diff line number Diff line Loading @@ -3,12 +3,12 @@ use File::Copy; use strict; if (-d "/opt/fi-printers") { #check print "Opt dir exits\n"; chdir "/opt/fi-printers"; my $output = `git pull --ff-only`; if ($output eq "Already up to date.\n") { print "Nothing to do"; # exit; exit; } } else Loading @@ -18,11 +18,7 @@ else } # copy cron.pl into weekly cron copy("/opt/fi-printers/cron.pl", "/etc/cron.weekly/fi_printers_cron.pl"); copy("/opt/fi-printers/cron.pl", "/etc/cron.weekly/fi_printers_cron"); my @files = glob( '/etc/cups/ppd/*.ppd' ); Loading @@ -36,9 +32,7 @@ for my $item (@files) { } for my $printer (@files) { my $command = "/opt/fi-printers/install.pl --update $printer"; print "$command \n"; system($command); system("/opt/fi-printers/install.pl --update $printer"); } install.pl +6 −4 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ use File::Path; use File::Copy; use File::Basename; use Getopt::Long qw(:config bundling); use FindBin '$RealBin'; #-------------------------------------------------------------------- Loading Loading @@ -296,15 +297,16 @@ sub pre_TA5007ci { } sub check_cron { if (! -e "/etc/cron.weekly/fi_printers_cron.pl") { if (! -e "/etc/cron.weekly/fi_printers_cron") { print "[PROMPT] Do you want to enable automatic updates via cron? [Y/n] "; chomp(my $answer = <STDIN>); if ($answer eq 'Y' || $answer eq 'y' || $answer eq '') { print "[INFO] Installing cron.\n"; copy("cron.pl", "/etc/cron.weekly/fi_printers_cron.pl") or die "Could not copy cron script\n"; chmod 0700, "/etc/cron.weekly/fi_printers_cron.pl"; copy("$RealBin/cron.pl", "/etc/cron.weekly/fi_printers_cron") or die "[ERROR] Could not copy cron script\n"; chmod 0700, "/etc/cron.weekly/fi_printers_cron"; say "[INFO] Cron installed"; } } else { Loading Loading
cron.pl +6 −12 Original line number Diff line number Diff line Loading @@ -3,12 +3,12 @@ use File::Copy; use strict; if (-d "/opt/fi-printers") { #check print "Opt dir exits\n"; chdir "/opt/fi-printers"; my $output = `git pull --ff-only`; if ($output eq "Already up to date.\n") { print "Nothing to do"; # exit; exit; } } else Loading @@ -18,11 +18,7 @@ else } # copy cron.pl into weekly cron copy("/opt/fi-printers/cron.pl", "/etc/cron.weekly/fi_printers_cron.pl"); copy("/opt/fi-printers/cron.pl", "/etc/cron.weekly/fi_printers_cron"); my @files = glob( '/etc/cups/ppd/*.ppd' ); Loading @@ -36,9 +32,7 @@ for my $item (@files) { } for my $printer (@files) { my $command = "/opt/fi-printers/install.pl --update $printer"; print "$command \n"; system($command); system("/opt/fi-printers/install.pl --update $printer"); }
install.pl +6 −4 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ use File::Path; use File::Copy; use File::Basename; use Getopt::Long qw(:config bundling); use FindBin '$RealBin'; #-------------------------------------------------------------------- Loading Loading @@ -296,15 +297,16 @@ sub pre_TA5007ci { } sub check_cron { if (! -e "/etc/cron.weekly/fi_printers_cron.pl") { if (! -e "/etc/cron.weekly/fi_printers_cron") { print "[PROMPT] Do you want to enable automatic updates via cron? [Y/n] "; chomp(my $answer = <STDIN>); if ($answer eq 'Y' || $answer eq 'y' || $answer eq '') { print "[INFO] Installing cron.\n"; copy("cron.pl", "/etc/cron.weekly/fi_printers_cron.pl") or die "Could not copy cron script\n"; chmod 0700, "/etc/cron.weekly/fi_printers_cron.pl"; copy("$RealBin/cron.pl", "/etc/cron.weekly/fi_printers_cron") or die "[ERROR] Could not copy cron script\n"; chmod 0700, "/etc/cron.weekly/fi_printers_cron"; say "[INFO] Cron installed"; } } else { Loading