Magellan Linux

Diff of /alx-src/branches/alxconf-060/functions/config_printers.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1972 by niro, Sat May 7 11:02:15 2011 UTC revision 2126 by niro, Mon May 16 12:23:08 2011 UTC
# Line 32  get_printer_settings() Line 32  get_printer_settings()
32  config_printing()  config_printing()
33  {  {
34   local port   local port
35     local CONFIG
36    
37   # first of all get the vars   # first of all get the vars
38   get_printer_settings   get_printer_settings
39    
40   # 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
41   :> /etc/printcap   CONFIG=/etc/printcap
42     clearconfig
43    
44   if [[ -d /var/spool/lpd ]]   if [[ -d /var/spool/lpd ]]
45   then   then
46   rm -rf /var/spool/lpd   rm -rf /var/spool/lpd
# Line 51  config_printing() Line 54  config_printing()
54   do   do
55   # get real port settings   # get real port settings
56   case ${ALX_PORT[${i}]} in   case ${ALX_PORT[${i}]} in
57   lpt[0-9]*) port="/dev/lp$(( ${port/lpt/}-1 ))" ;;   lpt[0-9]*) port="/dev/lp$(( ${ALX_PORT[${i}]/lpt/}-1 ))" ;;
58   com[0-9]*) port="/dev/ttyS$(( ${port/com/}-1 ))" ;;   com[0-9]*) port="/dev/ttyS$(( ${ALX_PORT[${i}]/com/}-1 ))" ;;
59   usb[0-9]*) port="/dev/usb/lp$(( ${port/usb/}-1 ))" ;;   usb[0-9]*) port="/dev/usb/lp$(( ${ALX_PORT[${i}]/usb/}-1 ))" ;;
60   #lpd) port="lpd://${ip}/${share}" ;;   #lpd) port="lpd://${ip}/${share}" ;;
61   #socket) port="socket://${ip}:${share}" ;;   #socket) port="socket://${ip}:${share}" ;;
62   esac   esac
63    
64   # now add new printers (writing printcap)   # now add new printers (writing printcap)
65   echo "#--- added by alxconfig ---" >> /etc/printcap   addconfig "#--- added by alxconfig ---"
66   echo "${ALX_PRINTER_NAME[${i}]}|${ALX_PRINTER_NAME[${i}]}" >> /etc/printcap   addconfig "${ALX_PRINTER_NAME[${i}]}|${ALX_PRINTER_NAME[${i}]}"
67   echo " :lp=${port}" >> /etc/printcap   addconfig " :lp=${port}"
68   echo " :sd=/var/spool/lpd/${ALX_PRINTER_NAME[${i}]}" >> /etc/printcap   addconfig " :sd=/var/spool/lpd/${ALX_PRINTER_NAME[${i}]}"
69   echo "#-----------------------"   addconfig "#-----------------------"
70   echo >> /etc/printcap   addconfig
71    
72   # install spooler directories   # install spooler directories
73   install -o lp -g lp -m0700 -d /var/spool/lpd/${ALX_PRINTER_NAME[${i}]}   install -o lp -g lp -m0700 -d /var/spool/lpd/${ALX_PRINTER_NAME[${i}]}

Legend:
Removed from v.1972  
changed lines
  Added in v.2126