Loading cron.pl +0 −4 Original line number Diff line number Diff line Loading @@ -13,7 +13,6 @@ if (-d "/opt/fi-printers") { } else { #clone my $output = `git clone https://gitlab.fi.muni.cz/unix/fi-printers.git /opt/fi-printers`; } Loading @@ -22,9 +21,6 @@ copy("/opt/fi-printers/cron.pl", "/etc/cron.weekly/fi_printers_cron"); my @files = glob( '/etc/cups/ppd/*.ppd' ); my @new_files = (); for my $item (@files) { print "current $item\n"; $item =~ s/\/etc\/cups\/ppd\///; Loading install.pl +21 −24 Original line number Diff line number Diff line Loading @@ -103,23 +103,17 @@ my $models = { # Option processing #-------------------------------------------------------------------- my $only_update = ''; my $only_usage = ''; my $only_cron = ''; my $options = {}; GetOptions( 'update' => \$only_update, 'cron' => \$only_cron, 'help|h|?' => \$only_usage, ) or die; GetOptions($options, qw(update cron help|h|?)); if ($only_usage || (@ARGV != 1 && !$only_cron)) { if ($options->{usage} || (@ARGV != 1 && !$options->{cron})) { usage(); } check_env(); if ($only_cron) { if ($options->{cron}) { check_cron(); exit; } Loading Loading @@ -235,16 +229,19 @@ sub print_printers { } sub usage { say "Script for installing faculty printers on Linux via Samba print server."; say "Requires local CUPS server running and Samba client installed."; say "usage: $0 (--cron|[--update] <printer-name>)"; say "Must be run as root."; say "Triumph-Adler 50007ci needs Python 2.7 as a dependency"; say "and will install 2 additional python modules automatically."; say "Option --update only updates installed printer."; say "Option --cron only prompts for cron installation."; print "\n"; print <<END; Script for installing faculty printers on Linux via Samba print server. usage: $0 (--cron|[--update] <printer-name>) Requires local CUPS server running and Samba client installed. Must be run as root. Triumph-Adler 50007ci needs Python 2.7 as a dependency and will install 2 additional python modules automatically. Option --update only updates installed printer. Option --cron only prompts for cron installation. END print_printers(); exit 1; Loading Loading @@ -348,7 +345,7 @@ if ($model eq "TA5007ci") { for my $filter (@{($models->{$model} // {})->{filters} // []}) { copy_filter($filter); } if ($only_update) { if ($options->{update}) { update_ppd("$printer_name"); say "[INFO] Update of $printer_name is completed."; } Loading Loading
cron.pl +0 −4 Original line number Diff line number Diff line Loading @@ -13,7 +13,6 @@ if (-d "/opt/fi-printers") { } else { #clone my $output = `git clone https://gitlab.fi.muni.cz/unix/fi-printers.git /opt/fi-printers`; } Loading @@ -22,9 +21,6 @@ copy("/opt/fi-printers/cron.pl", "/etc/cron.weekly/fi_printers_cron"); my @files = glob( '/etc/cups/ppd/*.ppd' ); my @new_files = (); for my $item (@files) { print "current $item\n"; $item =~ s/\/etc\/cups\/ppd\///; Loading
install.pl +21 −24 Original line number Diff line number Diff line Loading @@ -103,23 +103,17 @@ my $models = { # Option processing #-------------------------------------------------------------------- my $only_update = ''; my $only_usage = ''; my $only_cron = ''; my $options = {}; GetOptions( 'update' => \$only_update, 'cron' => \$only_cron, 'help|h|?' => \$only_usage, ) or die; GetOptions($options, qw(update cron help|h|?)); if ($only_usage || (@ARGV != 1 && !$only_cron)) { if ($options->{usage} || (@ARGV != 1 && !$options->{cron})) { usage(); } check_env(); if ($only_cron) { if ($options->{cron}) { check_cron(); exit; } Loading Loading @@ -235,16 +229,19 @@ sub print_printers { } sub usage { say "Script for installing faculty printers on Linux via Samba print server."; say "Requires local CUPS server running and Samba client installed."; say "usage: $0 (--cron|[--update] <printer-name>)"; say "Must be run as root."; say "Triumph-Adler 50007ci needs Python 2.7 as a dependency"; say "and will install 2 additional python modules automatically."; say "Option --update only updates installed printer."; say "Option --cron only prompts for cron installation."; print "\n"; print <<END; Script for installing faculty printers on Linux via Samba print server. usage: $0 (--cron|[--update] <printer-name>) Requires local CUPS server running and Samba client installed. Must be run as root. Triumph-Adler 50007ci needs Python 2.7 as a dependency and will install 2 additional python modules automatically. Option --update only updates installed printer. Option --cron only prompts for cron installation. END print_printers(); exit 1; Loading Loading @@ -348,7 +345,7 @@ if ($model eq "TA5007ci") { for my $filter (@{($models->{$model} // {})->{filters} // []}) { copy_filter($filter); } if ($only_update) { if ($options->{update}) { update_ppd("$printer_name"); say "[INFO] Update of $printer_name is completed."; } Loading