From 645e7cfadffaa205b3a7748451d51920cc019326 Mon Sep 17 00:00:00 2001 From: Nicolas Thill Date: Mon, 3 Sep 2007 15:33:05 +0000 Subject: [PATCH 1/1] p910nd fixes: * 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 | 22 ++++++++++++-------- net/p910nd/files/p910nd.conf | 6 +++--- net/p910nd/files/p910nd.init | 40 ++++++++++++++++++------------------ 3 files changed, 37 insertions(+), 31 deletions(-) diff --git a/net/p910nd/Makefile b/net/p910nd/Makefile index 89148d8f56..f4c5c298ae 100644 --- a/net/p910nd/Makefile +++ b/net/p910nd/Makefile @@ -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\"\\\"" diff --git a/net/p910nd/files/p910nd.conf b/net/p910nd/files/p910nd.conf index 6f61005a62..a9b61b2992 100644 --- a/net/p910nd/files/p910nd.conf +++ b/net/p910nd/files/p910nd.conf @@ -1,4 +1,4 @@ config p910nd - option portnumber - option device - option bidirectional + option device "/dev/usb/lp0" + option port 0 + option bidirectional 1 diff --git a/net/p910nd/files/p910nd.init b/net/p910nd/files/p910nd.init index 42e6fc38e1..bc21b20a9d 100644 --- a/net/p910nd/files/p910nd.init +++ b/net/p910nd/files/p910nd.init @@ -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 } -- 2.30.2