From: Felix Fietkau Date: Sun, 15 Oct 2006 21:13:15 +0000 (+0000) Subject: sync rc.common with kamikaze X-Git-Tag: whiterussian_rc6~85 X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=d86c4e810596a2a9733b8c60c00e0836d0c09f58;p=openwrt%2Fsvn-archive%2Fopenwrt.git sync rc.common with kamikaze SVN-Revision: 5129 --- diff --git a/openwrt/package/base-files/default/etc/rc.common b/openwrt/package/base-files/default/etc/rc.common index 20d1efa402..a08f5e523c 100755 --- a/openwrt/package/base-files/default/etc/rc.common +++ b/openwrt/package/base-files/default/etc/rc.common @@ -1,5 +1,9 @@ #!/bin/sh -. /etc/functions.sh +# Copyright (C) 2006 OpenWrt.org + +. $IPKG_INSTROOT/etc/functions.sh + +START=50 start() { return 0 @@ -27,12 +31,14 @@ shutdown() { } disable() { - rm -f /etc/rc.d/${initscript##*/} + name="$(basename "${initscript}")" + rm -f "$IPKG_INSTROOT/etc/rc.d/S??$name" } enable() { + name="$(basename "${initscript}")" disable - ln -s /etc/init.d/${initscript##*/} /etc/rc.d/${initscript##*/} + ln -s "/etc/init.d/$name" "$IPKG_INSTROOT/etc/rc.d/S${START}${name##S[0-9][0-9]}" } depends() { @@ -48,6 +54,8 @@ Available commands: stop Stop the service restart Restart the service reload Reload configuration files (or restart if that fails) + enable Enable service autostart + disable Disable service autostart $EXTRA_HELP EOF } @@ -68,6 +76,8 @@ eval "case \"\$action\" in restart) restart;; boot) boot;; shutdown) shutdown;; + enable) enable;; + disable) disable;; $cmds *) help;; esac"