Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FI printers over Samba on Linux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
unix
FI printers over Samba on Linux
Commits
cf99d8e6
There was an error fetching the commit references. Please try again later.
Commit
cf99d8e6
authored
4 years ago
by
Martin Klimes (k11m1)
Browse files
Options
Downloads
Patches
Plain Diff
beautify scripts
parent
8e963a10
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cron.pl
+0
-4
0 additions, 4 deletions
cron.pl
install.pl
+21
-24
21 additions, 24 deletions
install.pl
with
21 additions
and
28 deletions
cron.pl
+
0
−
4
View file @
cf99d8e6
...
@@ -13,7 +13,6 @@ if (-d "/opt/fi-printers") {
...
@@ -13,7 +13,6 @@ if (-d "/opt/fi-printers") {
}
}
else
else
{
{
#clone
my
$output
=
`
git clone https://gitlab.fi.muni.cz/unix/fi-printers.git /opt/fi-printers
`;
my
$output
=
`
git clone https://gitlab.fi.muni.cz/unix/fi-printers.git /opt/fi-printers
`;
}
}
...
@@ -22,9 +21,6 @@ copy("/opt/fi-printers/cron.pl", "/etc/cron.weekly/fi_printers_cron");
...
@@ -22,9 +21,6 @@ copy("/opt/fi-printers/cron.pl", "/etc/cron.weekly/fi_printers_cron");
my
@files
=
glob
(
'
/etc/cups/ppd/*.ppd
'
);
my
@files
=
glob
(
'
/etc/cups/ppd/*.ppd
'
);
my
@new_files
=
();
for
my
$item
(
@files
)
{
for
my
$item
(
@files
)
{
print
"
current
$item
\n
";
print
"
current
$item
\n
";
$item
=~
s/\/etc\/cups\/ppd\///
;
$item
=~
s/\/etc\/cups\/ppd\///
;
...
...
This diff is collapsed.
Click to expand it.
install.pl
+
21
−
24
View file @
cf99d8e6
...
@@ -103,23 +103,17 @@ my $models = {
...
@@ -103,23 +103,17 @@ my $models = {
# Option processing
# Option processing
#--------------------------------------------------------------------
#--------------------------------------------------------------------
my
$only_update
=
'';
my
$options
=
{};
my
$only_usage
=
'';
my
$only_cron
=
'';
GetOptions
(
$options
,
qw(update cron help|h|?)
);
GetOptions
(
if
(
$options
->
{
usage
}
||
(
@ARGV
!=
1
&&
!
$options
->
{
cron
}))
{
'
update
'
=>
\
$only_update
,
usage
();
'
cron
'
=>
\
$only_cron
,
'
help|h|?
'
=>
\
$only_usage
,
)
or
die
;
if
(
$only_usage
||
(
@ARGV
!=
1
&&
!
$only_cron
))
{
usage
();
}
}
check_env
();
check_env
();
if
(
$o
nly_
cron
)
{
if
(
$o
ptions
->
{
cron
}
)
{
check_cron
();
check_cron
();
exit
;
exit
;
}
}
...
@@ -235,16 +229,19 @@ sub print_printers {
...
@@ -235,16 +229,19 @@ sub print_printers {
}
}
sub
usage
{
sub
usage
{
say
print
<<END;
"
Script for installing faculty printers on Linux via Samba print server.
";
Script for installing faculty printers on Linux via Samba print server.
say
"
Requires local CUPS server running and Samba client installed.
";
usage: $0 (--cron|[--update] <printer-name>)
say
"
usage: $0 (--cron|[--update] <printer-name>)
";
say
"
Must be run as root.
";
Requires local CUPS server running and Samba client installed.
say
"
Triumph-Adler 50007ci needs Python 2.7 as a dependency
";
Must be run as root.
say
"
and will install 2 additional python modules automatically.
";
Triumph-Adler 50007ci needs Python 2.7 as a dependency
say
"
Option --update only updates installed printer.
";
and will install 2 additional python modules automatically.
say
"
Option --cron only prompts for cron installation.
";
Option --update only updates installed printer.
print
"
\n
";
Option --cron only prompts for cron installation.
END
print_printers
();
print_printers
();
exit
1
;
exit
1
;
...
@@ -348,7 +345,7 @@ if ($model eq "TA5007ci") {
...
@@ -348,7 +345,7 @@ if ($model eq "TA5007ci") {
for
my
$filter
(
@
{(
$models
->
{
$model
}
//
{})
->
{
filters
}
//
[]
})
{
for
my
$filter
(
@
{(
$models
->
{
$model
}
//
{})
->
{
filters
}
//
[]
})
{
copy_filter
(
$filter
);
copy_filter
(
$filter
);
}
}
if
(
$o
nly_
update
)
{
if
(
$o
ptions
->
{
update
}
)
{
update_ppd
("
$printer_name
");
update_ppd
("
$printer_name
");
say
"
[INFO] Update of
$printer_name
is completed.
";
say
"
[INFO] Update of
$printer_name
is completed.
";
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment