8 |
local prn_ids |
local prn_ids |
9 |
|
|
10 |
# first of all get the vars |
# first of all get the vars |
|
get_printer_settings |
|
11 |
prn_ids=$(mysqldo "select id from cfg_printers where serial='${ALX_SERIAL}'") |
prn_ids=$(mysqldo "select id from cfg_printers where serial='${ALX_SERIAL}'") |
12 |
|
|
13 |
# first of all delete all printers, by wiping /etc/printcap and all spooler directories |
# first of all delete all printers, by wiping /etc/printcap and all spooler directories |
14 |
CONFIG=/etc/printcap |
CONFIG="/etc/printcap" |
15 |
clearconfig |
clearconfig |
16 |
|
|
17 |
if [[ -d /var/spool/lpd ]] |
if [[ -d /var/spool/lpd ]] |
30 |
case ${cfg_printers_port} in |
case ${cfg_printers_port} in |
31 |
lpt[0-9]*) port="/dev/lp$(( ${cfg_printers_port/lpt/}-1 ))" ;; |
lpt[0-9]*) port="/dev/lp$(( ${cfg_printers_port/lpt/}-1 ))" ;; |
32 |
com[0-9]*) port="/dev/ttyS$(( ${cfg_printers_port/com/}-1 ))" ;; |
com[0-9]*) port="/dev/ttyS$(( ${cfg_printers_port/com/}-1 ))" ;; |
33 |
usb[0-9]*) port="/dev/usb/lp$(( $cfg_printers_port/usb/}-1 ))" ;; |
usb[0-9]*) port="/dev/usb/lp$(( ${cfg_printers_port/usb/}-1 ))" ;; |
34 |
#lpd) port="lpd://${ip}/${share}" ;; |
#lpd) port="lpd://${ip}/${share}" ;; |
35 |
#socket) port="socket://${ip}:${share}" ;; |
#socket) port="socket://${ip}:${share}" ;; |
36 |
esac |
esac |