Commit 6db9d671 authored by Martin Klimes (k11m1)'s avatar Martin Klimes (k11m1)
Browse files

Added generic printer + fixed url

parent 8db4f518
......@@ -66,7 +66,7 @@ sub hp_laserjet_600 {
# my $dir = cwd;
# say $dir;
my $url = get_url();
my $url = get_url($printer_name);
my $command = qq(lpadmin \\
-p "${printer_name}.fi.muni" \\
......@@ -85,9 +85,9 @@ sub hp_laserjet_600 {
system($command);
}
sub TA {
sub TA_4505ci {
my ($printer_name) = @_;
my $url = get_url();
my $url = get_url($printer_name);
# Add cups printer
# sudo lpadmin CLI CUPS administration
......@@ -123,6 +123,27 @@ sub TA {
system($command);
}
sub generic_printer {
my ($printer_name) = @_;
my $url = get_url($printer_name);
my $command = qq(lpadmin \\
-p "${printer_name}.fi.muni" \\
-D "${printer_name} (FI MUNI)" \\
-L "$printers->{$printer_name}->{'location'}" \\
-E \\
-v "${url}" \\
-P "ppds/${printer_name}.ppd" \\
-o media-default=iso_a4_210x297mm \\
-o sides-default=two-sided-long-edge \\
-o auth-info-required=username,password);
say $command;
system($command);
}
sub copy_filter {
(my $filter) = @_;
# my $filter = "kyofilter_B";
......@@ -142,14 +163,6 @@ sub copy_filter {
}
sub triumph_Adler_4505ci {
my ($printer_name) = @_;
}
sub print_printers() {
say "Available printers:";
printf "%-14s | %s\n", "Printer name", "Location";
......@@ -241,7 +254,7 @@ sub python_package {
}
sub TA5007ci {
sub pre_TA5007ci {
my $python = check_python;
python_package "PyPDF2-1.26.0", $python;
python_package "reportlab", $python;
......@@ -253,13 +266,18 @@ my $model = $printers->{$printer_name}->{'model'};
if ($model eq "TA5007ci") {
TA5007ci();
pre_TA5007ci();
}
if ($printers->{$printer_name}->{'model'} eq "hp-laserjet-600") {
hp_laserjet_600($printer_name);
if ($model eq "TA4505ci") {
TA_4505ci "$printer_name";
}
elsif ($model eq "hp-laserjet-600") {
hp_laserjet_600 $printer_name;
}
else {
generic_printer("$printer_name");
}
# NOTE there was a problem before // THIS DOESNT WORK?
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment