1 |
# $Id$ |
# $Id$ |
2 |
|
|
3 |
provide lprng |
provide printing lprng |
4 |
|
|
5 |
help_printing_printer() |
help_printing_printer() |
6 |
{ |
{ |
15 |
mecho |
mecho |
16 |
mecho " name - name of the printer" |
mecho " name - name of the printer" |
17 |
mecho " port - printing port (lpt1, usb1, com1 ... lptN, usbN, comN" |
mecho " port - printing port (lpt1, usb1, com1 ... lptN, usbN, comN" |
18 |
mecho " ip - ip of the remote printer - optional" |
# mecho " ip - ip of the remote printer - optional" |
19 |
mecho " share - share/port name of the remote printer - optional" |
# mecho " share - share/port name of the remote printer - optional" |
20 |
} |
} |
21 |
|
|
22 |
helper_addprinter() |
helper_addprinter() |
23 |
{ |
{ |
24 |
local name="$1" |
local name="$1" |
25 |
local port="$2" |
local port="$2" |
26 |
local ip="$3" |
# local ip="$3" |
27 |
local share="$4" |
# local share="$4" |
28 |
|
|
29 |
[[ -z ${name} ]] && help_printing_printer && return 1 |
[[ -z ${name} ]] && help_printing_printer && return 1 |
30 |
[[ -z ${port} ]] && help_printing_printer && return 1 |
[[ -z ${port} ]] && help_printing_printer && return 1 |
78 |
|
|
79 |
set_printing_printer() |
set_printing_printer() |
80 |
{ |
{ |
81 |
local action="$1" |
local action="${CLASS_ARGV[0]}" |
82 |
local name="$2" |
local name="${CLASS_ARGV[1]}" |
83 |
local port="$3" |
local port="${CLASS_ARGV[2]}" |
84 |
local ip="$4" |
# local ip="${CLASS_ARGV[3]}" |
85 |
local share="$5" |
# local share="${CLASS_ARGV[4]}" |
86 |
|
|
87 |
case "${action}" in |
case "${action}" in |
88 |
add) helper_addprinter "${name}" "${port}" "${ip}" "${share}" ;; |
# add) helper_addprinter "${name}" "${port}" "${ip}" "${share}" ;; |
89 |
|
add) helper_addprinter "${name}" "${port}";; |
90 |
del) helper_delprinter "${name}" ;; |
del) helper_delprinter "${name}" ;; |
91 |
*) help_printing_printer && return 1 ;; |
*) help_printing_printer && return 1 ;; |
92 |
esac |
esac |