p910nd fixes:
authorNicolas Thill <nico@openwrt.org>
Mon, 3 Sep 2007 15:33:05 +0000 (15:33 +0000)
committerNicolas Thill <nico@openwrt.org>
Mon, 3 Sep 2007 15:33:05 +0000 (15:33 +0000)
 * move DESCRIPTION to a separate macro
 * add conffiles back
 * indent initscript and config file
 * supply reasonable default config values

SVN-Revision: 8597

net/p910nd/Makefile
net/p910nd/files/p910nd.conf
net/p910nd/files/p910nd.init

index 89148d8f5601f5f5ea1b986b2397f4df49f419b7..f4c5c298aec2d08a6034411b3c9c645e6b611119 100644 (file)
@@ -22,17 +22,23 @@ define Package/p910nd
   SECTION:=net
   CATEGORY:=Network
   TITLE:=A small non-spooling printer server
-  DESCRIPTION:=\
-       p910nd is a small daemon that copies any data received on \\\
-       the port it is listening on to the  corresponding printer \\\
-       port. It  is primarily intended for diskless Linux hosts \\\
-       running as printer drivers but there is no reason why it \\\
-       could  not  be used on diskful hosts. Port 9100 is copied \\\
-       to /dev/lp0, 9101 to /dev/lp1 and 9102 to /dev/lp2. The \\\
-       default is port 9100 to /dev/lp0.
   URL:=http://www.etherboot.org/p910nd/
 endef
 
+define Package/p910nd/conffiles
+/etc/config/p910nd
+endef
+
+define Package/p910nd/description
+ p910nd is a small daemon that copies any data received on 
+ the port it is listening on to the  corresponding printer 
+ port. It  is primarily intended for diskless Linux hosts 
+ running as printer drivers but there is no reason why it 
+ could  not  be used on diskful hosts. Port 9100 is copied 
+ to /dev/lp0, 9101 to /dev/lp1 and 9102 to /dev/lp2. The 
+ default is port 9100 to /dev/lp0.
+endef
+
 MAKE_FLAGS += \
        CFLAGS="$(TARGET_CFLAGS) -DLOCKFILE_DIR=\"\\\"/tmp\"\\\""
 
index 6f61005a6217e02dbee30ff195da9719b08196cc..a9b61b299286a758dbb0f8c24838e2fd3caf68c2 100644 (file)
@@ -1,4 +1,4 @@
 config p910nd
-        option portnumber
-        option device
-        option bidirectional
+       option device        "/dev/usb/lp0"
+       option port           0
+       option bidirectional  1
index 42e6fc38e1563ff3d6735fe6647c47225da2264d..bc21b20a9db864ba2dff50d84fce21c1591deab2 100644 (file)
@@ -5,34 +5,34 @@ START=50
 BIN=p910nd
 
 start_service() {
-        local section="$1"
-        config_get      port          "$section" port
-        config_get      device        "$section" device
-        config_get_bool bidirectional "$section" bidirectional
-
-        options=""
-        [ $bidirectional -eq 1 ] && {
-                options="$options -b"
-        }
-        options="$options -f $device $port"
-
-        $BIN $options
+       local section="$1"
+       config_get      port          "$section" port
+       config_get      device        "$section" device
+       config_get_bool bidirectional "$section" bidirectional
+
+       options=""
+       [ $bidirectional -eq 1 ] && {
+               options="$options -b"
+       }
+       options="$options -f $device $port"
+
+       $BIN $options
 }
 
 stop_service() {
-        local section="$1"
-        config_get port "$section" port
+       local section="$1"
+       config_get port "$section" port
 
-        PID_F=/var/run/p910${port}d.pid
-        [ -f $PID_F ] && kill $(cat $PID_F)
+       PID_F=/var/run/p910${port}d.pid
+       [ -f $PID_F ] && kill $(cat $PID_F)
 }
 
 start() {
-        config_load "p910nd"
-        config_foreach start_service p910nd
+       config_load "p910nd"
+       config_foreach start_service p910nd
 }
 
 stop() {
-        config_load "p910nd"
-        config_foreach stop_service p910nd
+       config_load "p910nd"
+       config_foreach stop_service p910nd
 }