Changeset 2080


Ignore:
Timestamp:
2005-10-08T21:12:51+02:00 (11 years ago)
Author:
nico
Message:

change initscript to use more than one port / device,
bump release number.

Location:
trunk/openwrt/package/p910nd
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/openwrt/package/p910nd/Makefile

    r1993 r2080  
    33PKG_NAME:=p910nd 
    44PKG_VERSION:=0.7 
    5 PKG_RELEASE:=1 
     5PKG_RELEASE:=2 
    66PKG_MD5SUM:=7bf752532d26c9106f8039db95df3a6b 
    77 
  • trunk/openwrt/package/p910nd/files/p910nd.default

    r2000 r2080  
    1 # Port 9100 is copied to /dev/printers/0, 9101 to /dev/printers/1 
    2 # and 9102 to /dev/printers/2. The default is port 9100 to 
    3 # /dev/printers/0. 
    4 # Values are 0|1|2 
     1# printing port list, in the form "number [options]" 
     2# where: 
     3#  - number is the port number in the range [0-9] 
     4#    the p910nd daemon will listen on tcp port 9100+number 
     5#  - options can be : 
     6#    -b to turn on bidirectional copying. 
     7#    -f to specify a different printer device. 
    58# 
    6 # Port 9100 for USB connection 
    7 # Port 9101 for LPT connection 
    8 # 
    9 PORT="0" 
    10  
    11 # The -b option turns on bidirectional copying. 
    12 # The -f option can be used to specify a different printer device. 
    13 # 
    14 #OPTIONS="-b -f /dev/usblp0" 
     90  -b -f /dev/usb/lp0 
  • trunk/openwrt/package/p910nd/files/p910nd.init

    r2000 r2080  
    22 
    33DEFAULT=/etc/default/p910nd 
    4 [ -f $DEFAULT ] && . $DEFAULT 
    54RUN_D=/var/run 
    6 PID_F=$RUN_D/p910${PORT-0}d.pid 
     5 
     6_start() { 
     7 mkdir -p $RUN_D 
     8 [ -f $DEFAULT ] && ( 
     9  while read port options; do 
     10   case "$port" in 
     11    ""|\#*) 
     12     continue; 
     13   esac 
     14   p910nd $options $port 
     15   if [ $? -ne 0 ]; then 
     16    exit 1 
     17   fi 
     18  done 
     19 ) < $DEFAULT 
     20 exit 0 
     21} 
     22 
     23_stop() { 
     24 [ -f $DEFAULT ] && ( 
     25  while read port options; do 
     26   case "$port" in 
     27    ""|\#*) 
     28     continue; 
     29   esac 
     30   PID_F=$RUN_D/p910${port}d.pid 
     31   [ -f $PID_F ] && kill $(cat $PID_F) 
     32  done 
     33 ) < $DEFAULT 
     34} 
    735 
    836case $1 in 
    937 start) 
    10   mkdir -p $RUN_D 
    11   p910nd $OPTIONS $PORT 
     38  _start 
    1239  ;; 
    1340 stop) 
    14   [ -f $PID_F ] && kill $(cat $PID_F) 
     41  _stop 
    1542  ;; 
    1643 *) 
Note: See TracChangeset for help on using the changeset viewer.