ifplugd: only install default config if not provided in skeleton
authorPeter Korsgaard <jacmet@sunsite.dk>
Wed, 2 Jul 2008 07:20:16 +0000 (07:20 -0000)
committerPeter Korsgaard <jacmet@sunsite.dk>
Wed, 2 Jul 2008 07:20:16 +0000 (07:20 -0000)
package/ifplugd/ifplugd.mk

index 204bad7dcf64bca2eab1701894fd8c7371a62a1e..c91f96c3711d251d2bb4c57fded94f2b47b2f424 100644 (file)
@@ -18,12 +18,13 @@ $(eval $(call AUTOTARGETS,package,ifplugd))
 
 $(IFPLUGD_HOOK_POST_INSTALL):
        $(INSTALL) -d $(TARGET_DIR)/etc/ifplugd
-       $(INSTALL) $(IFPLUGD_DIR)/conf/ifplugd.conf $(TARGET_DIR)/etc/ifplugd/
+       @if [ ! -f $(TARGET_DIR)/etc/ifplugd/ifplugd.conf ]; then \
+               $(INSTALL) $(IFPLUGD_DIR)/conf/ifplugd.conf $(TARGET_DIR)/etc/ifplugd/; \
+               $(SED) 's^\(ARGS=.*\)w^\1^' $(TARGET_DIR)/etc/ifplugd/ifplugd.conf; \
+       fi
        $(INSTALL) -m 0755 $(IFPLUGD_DIR)/conf/ifplugd.action \
                $(TARGET_DIR)/etc/ifplugd/
        $(INSTALL) -m 0755 $(IFPLUGD_DIR)/conf/ifplugd.init \
                $(TARGET_DIR)/etc/init.d/S45ifplugd
-       # continue booting without waiting for fork (no -w option)
-       $(SED) 's^\(ARGS=.*\)w^\1^' $(TARGET_DIR)/etc/ifplugd/ifplugd.conf
        # don't use bash for init script
        $(SED) 's^/bin/bash^/bin/sh^g' $(TARGET_DIR)/etc/init.d/S45ifplugd