Commit 6462f9ff authored by Martin Klimes (k11m1)'s avatar Martin Klimes (k11m1)
Browse files

wrong chmod fix + cleanup

Upravil jsem kód podle připomínek xnovosa1
parent 2149c499
......@@ -153,9 +153,10 @@ sub install_printer {
-o sides-default=two-sided-long-edge \\
-o auth-info-required=username,password);
foreach ( $models->{ $printers->{$printer_name}->{'model'} }->{'options'} )
for my $option (
@{ $models->{ $printers->{$printer_name}->{'model'} }->{'options'} } )
{
$command = $command . ' -o $_ ';
$command .= " -o $option ";
}
system($command);
......@@ -177,7 +178,7 @@ sub copy_filter {
or die "[ERROR] Failed to copy $filter: $!\n";
say "[OK] Copied $filter.";
chmod( 755, $destination . $filter );
chmod( 0755, $destination . $filter );
return;
}
......@@ -291,11 +292,9 @@ if ( $model eq "TA5007ci" ) {
pre_TA5007ci();
}
# NOTE This could be written better but idk how
foreach ( $models->{$model}->{'filters'} ) {
foreach (@$_) {
copy_filter($_);
}
for my $filter ( @{ ( $models->{$model} // {} )->{filters} // [] } ) {
copy_filter($filter);
}
install_printer("$printer_name");
......
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