Standardize makefile and init script
authorFlorian Fainelli <florian@openwrt.org>
Sun, 13 May 2007 12:47:49 +0000 (12:47 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Sun, 13 May 2007 12:47:49 +0000 (12:47 +0000)
SVN-Revision: 7203

admin/gkrellmd/Makefile
admin/gkrellmd/files/gkrellmd.init

index 41462b1ab1024cc8fd788fd98026b0140c3937ba..1153b2743df5680ba6e8164b6d1b70cf1ad34c98 100644 (file)
@@ -1,3 +1,11 @@
+#
+# Copyright (C) 2007 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+# $Id: $
+
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gkrellmd
@@ -37,11 +45,9 @@ endef
 
 define Package/gkrellmd/install
        $(INSTALL_DIR) $(1)/usr/bin
-       $(CP) $(PKG_BUILD_DIR)/server/$(PKG_NAME) $(1)/usr/bin/
-
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/server/$(PKG_NAME) $(1)/usr/bin/
        $(INSTALL_DIR) $(1)/etc
-       $(CP) $(PKG_BUILD_DIR)/server/$(PKG_NAME).conf $(1)/etc/
-
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/server/$(PKG_NAME).conf $(1)/etc/
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/gkrellmd.init $(1)/etc/init.d/gkrellmd
 endef
index 8311d1d379bc64d020da58f751955bb75124811e..5bd88a94590d76c606b8ed5a3522c5d8fa29f50c 100644 (file)
@@ -1,9 +1,16 @@
 #!/bin/sh /etc/rc.common
+# Copyright (C) 2007 OpenWrt.org
+
+START=60
+BIN=gkrellmd
+RUN_D=/var/run
+PID_F=$RUN_D/$BIN.pid
 
 start() {
-       /usr/bin/gkrellmd
+       mkdir -p $RUN_D
+       $BIN $OPTIONS
 }
 
 stop() {
-       killall gkrellmd
+       [ -f $PID_F ] && kill $(cat $PID_F)
 }