Linux vmi284606.contaboserver.net 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Apache/2.4.57 (Ubuntu)
: 167.86.127.34 | : 216.73.217.31
Cant Read [ /etc/named.conf ]
7.2.24-0ubuntu0.18.04.17
root
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
share /
webmin /
lpadmin /
[ HOME SHELL ]
Name
Size
Permission
Action
images
[ DIR ]
drwxr-xr-x
lang
[ DIR ]
drwxr-xr-x
CHANGELOG
1.16
KB
-rw-r--r--
acl_security.pl
4.4
KB
-rwxr-xr-x
aix-lib.pl
9.45
KB
-rwxr-xr-x
ascii.txt
4.19
KB
-rw-r--r--
base_coas_driver
560
B
-rwxr-xr-x
bw.fig
2.75
KB
-rw-r--r--
bw.ps
6.46
KB
-rw-r--r--
caldera-driver.pl
12.31
KB
-rwxr-xr-x
cancel_all.cgi
535
B
-rwxr-xr-x
catalog.devices
12.34
KB
-rw-r--r--
cgi_args.pl
284
B
-rwxr-xr-x
cluster.cgi
2.06
KB
-rwxr-xr-x
cluster_add.cgi
2.13
KB
-rwxr-xr-x
cluster_delete.cgi
529
B
-rwxr-xr-x
colour.fig
2.91
KB
-rw-r--r--
colour.ps
6.63
KB
-rw-r--r--
config-AlmaLinux-7.0-ALL
323
B
-rw-r--r--
config-Amazon-Linux-2-ALL
323
B
-rw-r--r--
config-CentOS-Linux-7.0-ALL
323
B
-rw-r--r--
config-CentOS-Stream-Linux-8.0...
323
B
-rw-r--r--
config-CloudLinux-8.0-ALL
323
B
-rw-r--r--
config-Oracle-Linux-8.0-ALL
323
B
-rw-r--r--
config-Redhat-Enterprise-Linux...
323
B
-rw-r--r--
config-Rocky-Linux-7.0-ALL
323
B
-rw-r--r--
config-Scientific-Linux-7.0-AL...
323
B
-rw-r--r--
config-aix
281
B
-rw-r--r--
config-coherent-linux
323
B
-rw-r--r--
config-corel-linux
228
B
-rw-r--r--
config-debian-linux
228
B
-rw-r--r--
config-debian-linux-3.1-3.9
327
B
-rw-r--r--
config-debian-linux-4.0-ALL
333
B
-rw-r--r--
config-freebsd
230
B
-rw-r--r--
config-generic-linux
228
B
-rw-r--r--
config-gentoo-linux
248
B
-rw-r--r--
config-hpux
323
B
-rw-r--r--
config-irix
213
B
-rw-r--r--
config-macos
230
B
-rw-r--r--
config-mandrake-linux
245
B
-rw-r--r--
config-mandrake-linux-8.0-ALL
276
B
-rw-r--r--
config-msc-linux
228
B
-rw-r--r--
config-netbsd
230
B
-rw-r--r--
config-open-linux
309
B
-rw-r--r--
config-open-linux-3.1e
239
B
-rw-r--r--
config-openSUSE-Linux-15.0-ALL
318
B
-rw-r--r--
config-openbsd
230
B
-rw-r--r--
config-openmamba-linux
229
B
-rw-r--r--
config-pardus-linux
228
B
-rw-r--r--
config-redhat-linux
228
B
-rw-r--r--
config-redhat-linux-24.0-ALL
339
B
-rw-r--r--
config-redhat-linux-7.0
283
B
-rw-r--r--
config-redhat-linux-7.1
286
B
-rw-r--r--
config-redhat-linux-7.2-8.1
394
B
-rw-r--r--
config-redhat-linux-9.0-23.0
337
B
-rw-r--r--
config-slackware-linux
228
B
-rw-r--r--
config-slackware-linux-8.1-ALL
246
B
-rw-r--r--
config-solaris
304
B
-rw-r--r--
config-solaris-10-ALL
330
B
-rw-r--r--
config-solaris-9
296
B
-rw-r--r--
config-suse-linux
226
B
-rw-r--r--
config-suse-linux-8.2-ALL
322
B
-rw-r--r--
config-trustix-linux
313
B
-rw-r--r--
config-turbo-linux
228
B
-rw-r--r--
config-united-linux
322
B
-rw-r--r--
config-unixware
302
B
-rw-r--r--
config.info
1.31
KB
-rw-r--r--
config.info.ca
1.53
KB
-rw-r--r--
config.info.cs
1.25
KB
-rw-r--r--
config.info.de
1.43
KB
-rw-r--r--
config.info.es
1.17
KB
-rw-r--r--
config.info.fr
1.63
KB
-rw-r--r--
config.info.hu
707
B
-rw-r--r--
config.info.ja
823
B
-rw-r--r--
config.info.nl
1.41
KB
-rw-r--r--
config.info.no
1.37
KB
-rw-r--r--
config.info.pl
1.45
KB
-rw-r--r--
config.info.pt_BR
1.58
KB
-rw-r--r--
config.info.ru
1.74
KB
-rw-r--r--
config.info.sv
651
B
-rw-r--r--
config.info.tr
1.39
KB
-rw-r--r--
config.info.uk
1.81
KB
-rw-r--r--
config.info.zh
573
B
-rw-r--r--
config.info.zh_TW
539
B
-rw-r--r--
cups-driver.pl
6.37
KB
-rwxr-xr-x
cups-lib.pl
8.67
KB
-rwxr-xr-x
defaultacl
73
B
-rw-r--r--
delete_printer.cgi
690
B
-rwxr-xr-x
delete_printers.cgi
839
B
-rwxr-xr-x
drivers
18.34
KB
-rw-r--r--
edit_printer.cgi
10.08
KB
-rwxr-xr-x
freebsd-lib.pl
7.26
KB
-rwxr-xr-x
hpux-driver.pl
3.13
KB
-rwxr-xr-x
hpux-lib.pl
9.83
KB
-rwxr-xr-x
index.cgi
5.83
KB
-rwxr-xr-x
irix-driver.pl
3.13
KB
-rwxr-xr-x
irix-lib.pl
10.68
KB
-rwxr-xr-x
linux-lib.pl
8.97
KB
-rwxr-xr-x
list_jobs.cgi
2.25
KB
-rwxr-xr-x
log_parser.pl
1021
B
-rwxr-xr-x
lpadmin-lib.pl
19.89
KB
-rwxr-xr-x
lprng-lib.pl
10.26
KB
-rwxr-xr-x
module.info
494
B
-rw-r--r--
module.info.af
0
B
-rw-r--r--
module.info.af.auto
159
B
-rw-r--r--
module.info.ar
0
B
-rw-r--r--
module.info.ar.auto
223
B
-rw-r--r--
module.info.be
0
B
-rw-r--r--
module.info.be.auto
290
B
-rw-r--r--
module.info.bg
0
B
-rw-r--r--
module.info.bg.auto
306
B
-rw-r--r--
module.info.ca
167
B
-rw-r--r--
module.info.ca.auto
16
B
-rw-r--r--
module.info.cs
31
B
-rw-r--r--
module.info.cs.auto
155
B
-rw-r--r--
module.info.da
0
B
-rw-r--r--
module.info.da.auto
168
B
-rw-r--r--
module.info.de
148
B
-rw-r--r--
module.info.de.auto
16
B
-rw-r--r--
module.info.el
0
B
-rw-r--r--
module.info.el.auto
362
B
-rw-r--r--
module.info.es
38
B
-rw-r--r--
module.info.es.auto
157
B
-rw-r--r--
module.info.eu
0
B
-rw-r--r--
module.info.eu.auto
217
B
-rw-r--r--
module.info.fa
0
B
-rw-r--r--
module.info.fa.auto
246
B
-rw-r--r--
module.info.fi
0
B
-rw-r--r--
module.info.fi.auto
168
B
-rw-r--r--
module.info.fr
39
B
-rw-r--r--
module.info.fr.auto
176
B
-rw-r--r--
module.info.he
0
B
-rw-r--r--
module.info.he.auto
205
B
-rw-r--r--
module.info.hr
0
B
-rw-r--r--
module.info.hr.auto
188
B
-rw-r--r--
module.info.hu
19
B
-rw-r--r--
module.info.hu.auto
173
B
-rw-r--r--
module.info.it
0
B
-rw-r--r--
module.info.it.auto
177
B
-rw-r--r--
module.info.ja
27
B
-rw-r--r--
module.info.ja.auto
213
B
-rw-r--r--
module.info.ko
25
B
-rw-r--r--
module.info.ko.auto
176
B
-rw-r--r--
module.info.lt
0
B
-rw-r--r--
module.info.lt.auto
219
B
-rw-r--r--
module.info.lv
0
B
-rw-r--r--
module.info.lv.auto
189
B
-rw-r--r--
module.info.ms
152
B
-rw-r--r--
module.info.ms.auto
16
B
-rw-r--r--
module.info.mt
0
B
-rw-r--r--
module.info.mt.auto
196
B
-rw-r--r--
module.info.nl
33
B
-rw-r--r--
module.info.nl.auto
133
B
-rw-r--r--
module.info.no
31
B
-rw-r--r--
module.info.no.auto
137
B
-rw-r--r--
module.info.pl
160
B
-rw-r--r--
module.info.pl.auto
16
B
-rw-r--r--
module.info.pt
39
B
-rw-r--r--
module.info.pt.auto
149
B
-rw-r--r--
module.info.pt_BR
42
B
-rw-r--r--
module.info.pt_BR.auto
155
B
-rw-r--r--
module.info.ro
0
B
-rw-r--r--
module.info.ro.auto
199
B
-rw-r--r--
module.info.ru
25
B
-rw-r--r--
module.info.ru.auto
245
B
-rw-r--r--
module.info.sk
0
B
-rw-r--r--
module.info.sk.auto
184
B
-rw-r--r--
module.info.sl
0
B
-rw-r--r--
module.info.sl.auto
192
B
-rw-r--r--
module.info.sv
30
B
-rw-r--r--
module.info.sv.auto
141
B
-rw-r--r--
module.info.th
0
B
-rw-r--r--
module.info.th.auto
393
B
-rw-r--r--
module.info.tr
27
B
-rw-r--r--
module.info.tr.auto
166
B
-rw-r--r--
module.info.uk
0
B
-rw-r--r--
module.info.uk.auto
281
B
-rw-r--r--
module.info.ur
0
B
-rw-r--r--
module.info.ur.auto
304
B
-rw-r--r--
module.info.vi
0
B
-rw-r--r--
module.info.vi.auto
189
B
-rw-r--r--
module.info.zh
24
B
-rw-r--r--
module.info.zh.auto
136
B
-rw-r--r--
module.info.zh_TW
30
B
-rw-r--r--
module.info.zh_TW.auto
142
B
-rw-r--r--
old-caldera-driver.pl
9.74
KB
-rwxr-xr-x
openbsd-lib.pl
7.26
KB
-rwxr-xr-x
prefs.info
40
B
-rw-r--r--
printconf-driver.pl
9.52
KB
-rwxr-xr-x
rbac-mapping
248
B
-rw-r--r--
redhat-driver.pl
12.42
KB
-rwxr-xr-x
restart.cgi
301
B
-rwxr-xr-x
save_printer.cgi
5.85
KB
-rwxr-xr-x
solaris-driver.pl
4.03
KB
-rwxr-xr-x
solaris-lib.pl
12.17
KB
-rwxr-xr-x
sortdrivers-by-drv.pl
222
B
-rwxr-xr-x
sortdrivers.pl
242
B
-rwxr-xr-x
start.cgi
377
B
-rwxr-xr-x
stop.cgi
374
B
-rwxr-xr-x
stp
2.45
KB
-rw-r--r--
suse-driver.pl
10.62
KB
-rwxr-xr-x
test_form.cgi
887
B
-rwxr-xr-x
test_print.cgi
1.19
KB
-rwxr-xr-x
unixware-lib.pl
7.81
KB
-rwxr-xr-x
view_job.cgi
909
B
-rwxr-xr-x
webmin-driver.pl
1.04
KB
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : solaris-lib.pl
# solaris-lib.pl # Functions for solaris/hpux-style printer management # Find lpsched command # But first define the default. $config{'lpschedcmd'} = "/usr/lib/lp/lpsched"; if (-x "/usr/lib/lpsched") { $config{'lpschedcmd'} = "/usr/lib/lpsched"; } $interface_dir = "/usr/lib/lp/model"; $default_interface = "$interface_dir/standard"; $netstandard_interface = "$interface_dir/netstandard"; $foomatic_interface = "$interface_dir/standard_foomatic"; $foomatic_netstandard_interface = "$interface_dir/netstandard_foomatic"; # list_printers() # Returns an array of known printer names sub list_printers { return () if (!&sched_running()); local(@rv, $_); if (open(CONF, "</etc/printers.conf")) { # Printers can be read from a file while(<CONF>) { s/\r|\n//g; s/#.*$//; if (/^(\S+):/ && $1 ne '_default') { push(@rv, $1); } } close(CONF); } else { # Must use a command to get printers open(STAT, "lpstat -v |"); while(<STAT>) { if (/\s+for\s+(\S+):/i && $1 ne '_default') { push(@rv, $1); } } close(STAT); } return &unique(@rv); } # get_printer(name, [nostatus]) # Returns a reference to an associative array of printer details sub get_printer { local($stat, @rv, $body, $avl, $con, $sys, %prn, $_, $out); local $esc = quotemeta($_[0]); $out = &backquote_command("lpstat -l -p $esc", 1); if ($out =~ /^printer\s+(\S+)\s*(.*)\s+(enabled|disabled)\s+since\s+([^\.]*)\.\s+(.*)\.\n([\000-\377]*)$/) { # printer exists $prn{'name'} = $1; $prn{'enabled'} = $3 eq "enabled"; $body = $6; } elsif ($out =~ /^printer\s+(\S+)\s+waiting for auto-retry.\s+(\S+)\.\n([\000-\377]*)$/) { # printer has some problem $prn{'name'} = $1; $prn{'enabled'} = 1; $body = $3; } else { # no printer found return undef; } if (!$prn{'enabled'} && $body =~ /^\s+(.*)/) { $prn{'enabled_why'} = $1 eq "unknown reason" ? "" : $1; } if ($body =~ /Description: (.*)/) { $prn{'desc'} = $1; } if ($body =~ /Printer types: (.*)/) { $prn{'ptype'} = $1; } if ($body =~ /Interface: (.*)/ && $1 ne $default_interface) { $prn{'iface'} = $1; } if ($body =~ /Banner not required/) { $prn{'banner'} = 0; } else { $prn{'banner'} = 1; } if ($body =~ /Content types: (.*)/) { $prn{'ctype'} = [ split(/[ ,]+/, $1) ]; } if ($body =~ /Users (allowed|denied):\n((\s+\S+\n)+)/) { local(@l); @l = grep { $_ } split(/\s+/, $2); if ($1 eq "allowed") { if ($l[0] eq "(all)") { $prn{'allow_all'} = 1; } elsif ($l[0] eq "(none)") { $prn{'deny_all'} = 1; } else { $prn{'allow'} = \@l; } } else { $prn{'deny'} = \@l; } } if ($body =~ /Options:\s*(.*)/) { local $opts = $1; local $o; foreach $o (split(/,\s*/, $opts)) { local ($on, $ov) = split(/=/, $o); $prn{'options'}->{$on} = $ov; } } if ($body =~ /PPD:\s+(\S+)/ && $1 ne "none" && $1 ne "/dev/null") { $prn{'ppd'} = $1; } if (!$_[1]) { # request availability $avl = &backquote_command("lpstat -a $esc 2>&1", 1); if ($avl =~ /^\S+\s+not accepting.*\n\s+(.*)/) { $prn{'accepting'} = 0; $prn{'accepting_why'} = $1; if ($prn{'accepting_why'} eq "unknown reason") { $prn{'accepting_why'} = ""; } } else { $prn{'accepting'} = 1; } } # request connection $con = &backquote_command("lpstat -v $esc 2>&1", 1); if ($con =~ /^device for \S+:\s+(\S+)/) { # Prints to a local file $prn{'dev'} = $1; if ($prn{'dev'} eq "/dev/null" && ($prn{'iface'} eq $netstandard_interface || $prn{'iface'} eq $foomatic_netstandard_interface)) { # Actually a remote TCP printer local ($dh, $dp) = split(/:/, $prn{'options'}->{'dest'}); if ($dh) { $prn{'dhost'} = $dh; $prn{'dport'} = $dp; delete($prn{'dev'}); delete($prn{'iface'}); } } } elsif ($con =~ /^system for \S+:\s+(\S+)\s+\(as printer (\S+)\)/ || $con =~ /^system for \S+:\s+(\S+)/) { # Prints to a remote server $prn{'rhost'} = $1; $prn{'rqueue'} = $2 || $prn{'name'}; $sys = &backquote_command("lpsystem -l $prn{'rhost'} 2>&1", 1); $sys =~ /Type:\s+(\S+)/; $prn{'rtype'} = $1; } # Check if this is the default printer if (!defined($default_printer)) { if (&backquote_command("lpstat -d 2>&1", 1) =~ /destination:\s+(\S+)/) { $default_printer = $1; } } if ($default_printer eq $prn{'name'}) { $prn{'default'} = 1; } return \%prn; } # get_jobs(printer) sub get_jobs { local @jobs; if ($_[0] =~ /\-/ || $config{'always_lpq'}) { # Apparently lpq must be used if the printer name contains a - local $esc = quotemeta($_[0]); local $lpq = &has_command("lpq") || "/usr/ucb/lpq"; open(LPQ, "$lpq -P$esc |"); while(<LPQ>) { s/\r|\n//g; if (/^Rank\s+Owner\s+/i) { $doneheader++; } elsif ($doneheader && /^(\S+)\s+(\S+)\s+(\d+)\s+(.*\S)\s+(\d+)\s+(\S+)$/) { local(%job); $job{'id'} = $3; $job{'user'} = $2; $job{'size'} = $5; $job{'file'} = $4; $job{'printing'} = ($1 eq "active"); push(@jobs, \%job); } } close(LPQ); } else { # Can use the normal lpstat command local $esc = quotemeta($_[0]); open(STAT, "lpstat -o $esc |"); while(<STAT>) { if (/^(\S+-(\d+))\s+(\S+)\s+(\d+)\s+(\S+ \d+ \d+:\d+)\s+(.*)/) { local(%job, $d, $f, @pf); $job{'id'} = $1; local $id = $2; $job{'user'} = $3; $job{'size'} = $4; $job{'when'} = $5; $job{'printing'} = ($6 =~ /^on /); if ($job{'user'} =~ /(\S+)\!/ && -d ($d="/var/spool/lp/tmp/$1")) { opendir(DIR, $d); foreach $f (readdir(DIR)) { push(@pf, "$d/$f") if ($f =~ /^$id-[1-9]/); } closedir(DIR); $job{'printfile'} = @pf ? \@pf : undef; } push(@jobs, \%job); } } close(STAT); } return @jobs; } # printer_support(option) sub printer_support { return $_[0] !~ /^(msize|alias|riface|rnoqueue|ipp)$/; } # list_classes() # Returns an associative array of print classes sub list_classes { local($stat, %rv); $stat = &backquote_command("lpstat -c 2>&1", 1); while($stat =~ /^members of class (\S+):\n((\s+\S+\n)+)([\000-\377]*)$/) { $stat = $4; $rv{$1} = [ grep { $_ ne "" } split(/\s+/, $2) ]; } return \%rv; } # create_printer(&details) # Create a new printer sub create_printer { &modify_printer($_[0]); } # modify_printer(&details) # Change an existing printer sub modify_printer { local(%prn, $cmd, $out); %prn = %{$_[0]}; local $old = &get_printer($prn{'name'}); # call lpsystem if needed local $tesc = quotemeta($prn{'rtype'}); local $resc = quotemeta($prn{'rhost'}); local $qesc = quotemeta($prn{'rqueue'}); if ($prn{'rhost'}) { $out = &backquote_logged( "lpsystem -t $tesc $resc 2>&1"); if ($?) { &error("lpsystem failed : <pre>$out</pre>"); } } # call lpadmin local $esc = quotemeta($prn{'name'}); local $desc = quotemeta($prn{'desc'}) || "''"; $cmd = "lpadmin -p $esc -D $desc"; if ($prn{'allow_all'}) { $cmd .= " -u allow:all"; } elsif ($prn{'deny_all'}) { $cmd .= " -u deny:all"; } elsif ($prn{'allow'}) { &system_logged("lpadmin -p $esc -u deny:all >/dev/null 2>&1"); $cmd .= " -u allow:".join(',', map { quotemeta($_) } @{$prn{'allow'}}); } elsif ($prn{'deny'}) { &system_logged("lpadmin -p $esc -u allow:all >/dev/null 2>&1"); $cmd .= " -u deny:".join(',', map { quotemeta($_) } @{$prn{'deny'}}); } if ($prn{'dev'}) { # Just printing to a device file local $vesc = quotemeta($prn{'dev'}); $cmd .= " -v $vesc"; if ($prn{'iface'}) { local $iesc = quotemeta($prn{'iface'}); $cmd .= " -i $iesc"; } else { if ($prn{'ppd'}) { $cmd .= " -i $foomatic_interface"; } else { $cmd .= " -i $default_interface"; } } if ($prn{'banner'}) { $cmd .= " -o banner"; } else { $cmd .= " -o nobanner"; } } elsif ($prn{'dhost'}) { # Printing to a remote host local $hesc = quotemeta($prn{'dhost'}); local $pesc = quotemeta($prn{'dport'}); $cmd .= " -v /dev/null -o dest=$hesc:$pesc -o protocol=tcp"; if ($prn{'ppd'}) { $cmd .= " -i $foomatic_netstandard_interface"; } else { $cmd .= " -i $netstandard_interface"; } if ($prn{'banner'}) { $cmd .= " -o banner"; } else { $cmd .= " -o nobanner"; } } else { # Printing to remote LPR server $cmd .= " -s $resc!$qesc"; } # Add any content types local @ctype = @{$prn{'ctype'}}; if (@ctype) { $cmd .= " -I ".join(',' , @ctype); } # Add PPD option if ($_[0]->{'ppd'}) { $cmd .= " -n ".quotemeta($_[0]->{'ppd'}); } elsif ($old->{'ppd'}) { # Need to clear out PPD .. but how? $cmd .= " -n /dev/null"; } local $out = &backquote_logged("cd / ; $cmd 2>&1"); if ($?) { &error("lpadmin failed : <pre>$out ($cmd)</pre>"); } # make the default if ($prn{'default'}) { $out = &backquote_logged("cd / ; lpadmin -d $esc 2>&1"); if ($?) { &error("Failed to set default : <pre>$out</pre>"); } } # Build filter table &open_execute_command(STAT, "/usr/bin/ls -1 /etc/lp/fd/*.fd", 1, 1); while(<STAT>) { $file = substr($_, rindex($_, "/") +1, -4 ); &system_logged("/usr/sbin/lpfilter -f $file -F /etc/lp/fd/$file.fd"); } close(STAT); # enable or disable if ($prn{'enabled'}) { $cmd = "enable $esc"; } elsif ($prn{'enabled_why'}) { local $wesc = quotemeta($prn{'enabled_why'}); $cmd = "enable $esc ; disable -r $wesc $esc"; } else { $cmd = "enable $esc ; disable $esc"; } $out = &backquote_logged("$cmd 2>&1"); # accepting or rejecting requests if ($prn{'accepting'}) { $cmd = "accept $esc"; } elsif ($prn{'accepting_why'}) { local $wesc = quotemeta($prn{'accepting_why'}); $cmd = "accept $esc ; reject -r $wesc $esc"; } else { $cmd = "accept $esc ; reject $esc"; } $out = &backquote_logged("$cmd 2>&1"); } # delete_printer(name) # Deletes some existing printer sub delete_printer { local($out); local $esc = quotemeta($_[0]); $out = &backquote_logged("lpadmin -x $esc 2>&1"); if ($?) { &error("lpadmin failed : <pre>$out</pre>"); } } # cancel_job(printer, id) # Cancels some print job sub cancel_job { local($out); local $iesc = quotemeta($_[1]); if ($_[0] =~ /\-/ || $config{'always_lpq'}) { # lprm must be used if printer name contains a - local $esc = quotemeta($_[0]); local $lprm = &has_command("lprm") || "/usr/ucb/lprm"; $out = &backquote_logged("$lprm -P$esc $iesc 2>&1"); if ($?) { &error("cancel failed : <pre>$out</pre>"); } } else { $out = &backquote_logged("cancel $iesc 2>&1"); if ($?) { &error("cancel failed : <pre>$out</pre>"); } } sleep(1); } # sched_running() # Returns the pid if lpsched is running, 0 if not, -1 if cannot be stopped sub sched_running { local @pid = &find_byname("lpsched"); if (@pid) { return $pid[0]; } return 0; } # start_sched() # Start lpsched sub start_sched { local $out = &backquote_logged("$config{'lpschedcmd'} 2>&1"); if ($?) { &error("failed to start lpsched : <tt>$out</tt>"); } } # stop_sched(pid) # Stop the running lpsched process sub stop_sched { local $out = &backquote_logged("lpshut 2>&1"); if ($?) { &error("lpshut failed : <tt>$out</tt>"); } } # print_command(printer, file) # Returns the command to print some file on some printer sub print_command { local $esc = quotemeta($_[0]); local $fesc = quotemeta($_[1]); return "lp -d $esc $fesc"; } # check_print_system() sub check_print_system { local $lpschedcmd = $config{'lpschedcmd'}; &has_command("lpstat") || return &text('solaris_ecmd', "<tt>lpstat</tt>"); &has_command("$lpschedcmd") || return &text('solaris_ecmd', "<tt>$lpschedcmd</tt>"); return undef; } # # get_device_files() # sub get_device_files { local @files; # # There are a string of files that could be used here, include only the # ones that actually exist. Start with the parallel ports, and then the # term ports, lp and printers/*. $devlist = "/dev/bpp*"; $devlist .= " /dev/ecpp*"; $devlist .= " /dev/term/*"; $devlist .= " /dev/lp*"; $devlist .= " /dev/printers/*"; open(DEV, "/bin/find $devlist -print 2>/dev/null |"); while(<DEV>) { push (@files, $_); } close(DEV); # # And also include /dev/null # push (@files, "/dev/null"); return @files; } # # get_device_names(@files) # sub get_device_names { local @files = @_; local @names; # # There are a string of files that could be used here, include only the # ones that actually exist. Start with the parallel ports, and then the # term ports, lp and printers/*. for (@files) { if (/bpp/) { push(@names, "$text{'solaris_paralel'} - $_"); } elsif (/ecpp/) { push(@names, "$text{'solaris_paralel'} - $_"); } elsif (/term\/a/) { push(@names, &text('solaris_serial', 'A') . " - $_"); } elsif (/term\/b/) { push(@names, &text('solaris_serial', 'B') . " - $_"); } elsif (/null/) { push(@names, "$text{'solaris_null'} - $_"); } else { push(@names, "$_"); } } return @names; } @device_files = &get_device_files(); @device_names = &get_device_names(@device_files);
Close