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 218 by niro, Tue Mar 8 20:29:46 2005 UTC revision 270 by niro, Wed Apr 20 11:46:41 2005 UTC
# Line 1  Line 1 
1    # $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/functions/config_printers.sh,v 1.8 2005-04-20 11:46:41 niro Exp $
2  # configures printing on the host via mysql db settings  # configures printing on the host via mysql db settings
3    
 #delme settings  
 SQL_USER=alx_install  
 SQL_PASS=@lx  
 SQL_HOST=128.20.41.110  
 SQL_DB=alx_web  
 ALX_SERIAL=10  
   
4  get_printer_settings()  get_printer_settings()
5  {  {
6   local i all count prn_ids settings DB_PRINTER   local i all count prn_ids settings DB_PRINTER
# Line 48  get_printer_settings() Line 42  get_printer_settings()
42   done   done
43    
44   # DEBUG MSG   # DEBUG MSG
45   for (( i=0; i <= count; i++ ))  # for (( i=0; i <= count; i++ ))
46   do  # do
47   echo -n "${ALX_PRINTER_NAME[${i}]} "  # echo -n "${ALX_PRINTER_NAME[${i}]} "
48   echo -n "${ALX_PORT[${i}]} "  # echo -n "${ALX_PORT[${i}]} "
49   echo -n "${ALX_IP[${i}]} "  # echo -n "${ALX_IP[${i}]} "
50   echo "${ALX_SHARE[${i}]}"  # echo "${ALX_SHARE[${i}]}"
51   done  # done
52    
53   # export all settings   # export all settings
54   export ALX_COUNT=${count}   export ALX_COUNT=${count}
# Line 64  get_printer_settings() Line 58  get_printer_settings()
58   export ALX_SHARE   export ALX_SHARE
59  }  }
60    
61  config_printing()  config_printing_old()
62  {  {
63   local port   local port
64    
# Line 80  config_printing() Line 74  config_printing()
74   /etc/init.d/cups start &> /dev/null   /etc/init.d/cups start &> /dev/null
75    
76   # debug   # debug
77   echo "ALX_COUNT: ${ALX_COUNT}"  # echo "ALX_COUNT: ${ALX_COUNT}"
78    
79   for (( i=0; i < ALX_COUNT; i++ ))   for (( i=0; i < ALX_COUNT; i++ ))
80   do   do
81   # get real port settings   # get real port settings
# Line 107  config_printing() Line 102  config_printing()
102   done   done
103  }  }
104    
105  config_printing2()  config_printing()
106  {  {
107   local port   local port
108    
# Line 120  config_printing2() Line 115  config_printing2()
115   :> /etc/cups/printers.conf   :> /etc/cups/printers.conf
116    
117   # debug   # debug
118   echo "ALX_COUNT: ${ALX_COUNT}"  # echo "ALX_COUNT: ${ALX_COUNT}"
119    
120   for (( i=0; i < ALX_COUNT; i++ ))   for (( i=0; i < ALX_COUNT; i++ ))
121   do   do
122   # get real port settings   # get real port settings
# Line 155  config_printing2() Line 151  config_printing2()
151   echo "KLimit 0" >> /etc/cups/printers.conf   echo "KLimit 0" >> /etc/cups/printers.conf
152   echo "</Printer>" >> /etc/cups/printers.conf   echo "</Printer>" >> /etc/cups/printers.conf
153   done   done
154    
155     # setup lpd print-services
156     echo "printer stream tcp nowait lp /usr/lib/cups/daemon/cups-lpd cups-lpd" > /etc/inetd.conf
157    
158     # start samba and cups if ALX_COUNT > 0
159     if [[ ${ALX_COUNT} != 0 ]]
160     then
161    # echo "DEBUG: adding samba+cups+inetd"
162     rc-config add inetd &> /dev/null
163     rc-config add cups &> /dev/null
164     rc-config add samba &> /dev/null
165     else
166    # echo "DEBUG: deleting samba+cups+inetd"
167     rc-config del inetd &> /dev/null
168     rc-config del cups &> /dev/null
169     rc-config del samba &> /dev/null
170     fi
171  }  }

Legend:
Removed from v.218  
changed lines
  Added in v.270