#------------------------------------------------------------------------------ # /etc/rc.d/rc450.lpdsrv - start non-spooling-lpd __FLI4LVER__ # was file /etc/rc.d/rc551.lpdsrv # # Creation : 20.05.2001 ss # Last Update: $Id$ #------------------------------------------------------------------------------ if [ "$OPT_LPDSRV" = "yes" ] then begin_script LPDSRV "configuring lpdsrv ..." port='' io='' rcommand='' fcommand='' netcommand='' parport='' irq='' interrupt='' dma='' direct='' portnr='' ip='' # ------------------------------------------------------------------------- # local parallel ports: #-------------------------------------------------------------------------- idx='1' idy='0' if [ "$OPT_LPDSRV_PARPORT" = "yes" -a "0$LPDSRV_PARPORT_N" -gt 0 ] then while [ "$idx" -le "$LPDSRV_PARPORT_N" ] do eval port='$LPDSRV_PARPORT_'$idx'_IO' eval interrupt='$LPDSRV_PARPORT_'$idx'_IRQ' eval direct='$LPDSRV_PARPORT_'$idx'_DMA' port=`echo $port | tr 'A-FX' 'a-fx'` rcommand="$rcommand -r pr$idx:/dev/lp$idy" fcommand="$fcommand -f prf$idx:/dev/lp$idy" if [ "$interrupt" = "yes" ] then interrupt='auto' else interrupt='none' fi if [ "$direct" = "yes" ] then direct='auto' else direct='none' fi if [ -z "$parport" ] then parport="$idy" else parport="$parport,$idy" fi if [ -z "$io" ] then io="$port" else io="$io,$port" fi if [ -z "$irq" ] then irq="$interrupt" else irq="$irq,$interrupt" fi if [ -z "$dma" ] then dma="$direct" else dma="$dma,$direct" fi idx=`expr $idx + 1` idy=`expr $idy + 1` done fi #-------------------------------------------------------------------------- # local usb ports: #-------------------------------------------------------------------------- idx='1' idy='0' if [ "$OPT_LPDSRV_USBPORT" = "yes" -a "0$LPDSRV_USBPORT_N" -gt 0 ] then while [ "$idx" -le "$LPDSRV_USBPORT_N" ] do eval port='$LPDSRV_USBPORT_'$idx /bin/mknod /dev/usblp$idy c 180 $idy rcommand="$rcommand -r usbpr$idx:/dev/usblp$idy" fcommand="$fcommand -f usbprf$idx:/dev/usblp$idy" idx=`expr $idx + 1` idy=`expr $idy + 1` done fi #-------------------------------------------------------------------------- # remote printers: #-------------------------------------------------------------------------- idx='1' idy='0' if [ "$OPT_LPDSRV_REMOTE" = "yes" -a "0$LPDSRV_REMOTE_N" -gt 0 ] then while [ "$idx" -le "$LPDSRV_REMOTE_N" ] do /bin/mknod /dev/fifo$idy p rcommand="$rcommand -r repr$idx:/dev/fifo$idy" idx=`expr $idx + 1` idy=`expr $idy + 1` done fi #-------------------------------------------------------------------------- # accepted networks: #-------------------------------------------------------------------------- idx='1' if [ "0$LPDSRV_NETWORK_N" -gt 0 ] then while [ "$idx" -le "$LPDSRV_NETWORK_N" ] do eval net='$LPDSRV_NETWORK_'$idx if [ -z "$netcommand" ] then netcommand="-n $net" else netcommand="$netcommand -n $net" fi idx=`expr $idx + 1` done fi #-------------------------------------------------------------------------- # load drivers: #-------------------------------------------------------------------------- if [ "$OPT_LPDSRV_PARPORT" = "yes" -a "0$LPDSRV_PARPORT_N" -gt 0 ] then do_modprobe parport_pc io=$io irq=$irq dma=$dma do_modprobe lp parport=$parport fi if [ "$OPT_LPDSRV_USBPORT" = "yes" -a "0$LPDSRV_USBPORT_N" -gt 0 ] then case "$kernel_major" in 2.6) do_modprobe usblp ;; 2.4) do_modprobe printer ;; esac fi #-------------------------------------------------------------------------- # start server: #-------------------------------------------------------------------------- if [ "$OPT_LPDSRV_PARPORT" = "yes" -o "$OPT_LPDSRV_USBPORT" = "yes" -o "$OPT_LPDSRV_REMOTE" = "yes" ] then if [ "0$LPDSRV_PARPORT_N" -gt 0 -o "0$LPDSRV_USBPORT_N" -gt 0 -o "0$LPDSRV_REMOTE_N" -gt 0 ] then /usr/sbin/lpdsrv -v $netcommand $rcommand $fcommand fi fi if [ "$OPT_LPDSRV_REMOTE" = "yes" -a "0$LPDSRV_REMOTE_N" -gt 0 ] then idx='1' idy='0' while [ "$idx" -le "$LPDSRV_REMOTE_N" ] do eval ip='$LPDSRV_REMOTE_'$idx'_IP' eval portnr='$LPDSRV_REMOTE_'$idx'_PORTNR' cat <