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 41462b1..1153b27 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 8311d1d..5bd88a9 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)
 }