Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
unix
FI printers over Samba on Linux
Commits
db4ec02e
Commit
db4ec02e
authored
Feb 19, 2021
by
Martin Klimes (k11m1)
Browse files
better ppd filtering + fix whitespaces
parent
2b2b4b48
Changes
2
Hide whitespace changes
Inline
Side-by-side
cron.pl
View file @
db4ec02e
...
...
@@ -22,13 +22,13 @@ copy("/opt/fi-printers/cron.pl", "/etc/cron.weekly/fi_printers_cron");
my
@files
=
glob
(
'
/etc/cups/ppd/*fi.muni.ppd
'
);
for
my
$item
(
@files
)
{
print
"
current
$item
\n
";
$item
=~
s/\/etc\/cups\/ppd\///
;
$item
=~
s/\.fi\.muni\.ppd//
;
print
"
current
$item
\n
";
$item
=~
s/\/etc\/cups\/ppd\///
;
$item
=~
s/\.fi\.muni\.ppd//
;
}
for
my
$printer
(
@files
)
{
system
("
/opt/fi-printers/install.pl --update
$printer
");
system
("
/opt/fi-printers/install.pl --update
$printer
");
}
install.pl
View file @
db4ec02e
...
...
@@ -11,7 +11,6 @@ use File::Basename;
use
Getopt::
Long
qw(:config bundling)
;
use
FindBin
'
$RealBin
';
#--------------------------------------------------------------------
# DATA
#--------------------------------------------------------------------
...
...
@@ -185,15 +184,15 @@ sub install_printer {
}
sub
update_ppd
{
my
(
$printer_name
)
=
@_
;
my
(
$printer_name
)
=
@_
;
my
$command
=
qq(lpadmin \\
-p "${printer_name}.fi.muni" \\
-P "ppds/${printer_name}.ppd" )
;
my
$command
=
qq(lpadmin \\
-p "${printer_name}.fi.muni" \\
-P "ppds/${printer_name}.ppd" )
;
system
(
$command
);
system
(
$command
);
return
;
return
;
}
sub
copy_filter
{
...
...
@@ -346,12 +345,12 @@ for my $filter (@{($models->{$model} // {})->{filters} // []}) {
copy_filter
(
$filter
);
}
if
(
$options
->
{
update
})
{
update_ppd
("
$printer_name
");
say
"
[INFO] Update of
$printer_name
is completed.
";
update_ppd
("
$printer_name
");
say
"
[INFO] Update of
$printer_name
is completed.
";
}
else
{
install_printer
("
$printer_name
");
say
"
[INFO] Installation of
$printer_name
is completed.
";
install_printer
("
$printer_name
");
say
"
[INFO] Installation of
$printer_name
is completed.
";
check_cron
();
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment