X-Git-Url: http://git.ozo.com/?a=blobdiff_plain;f=package%2Fbase-files%2Fdefault%2Fetc%2Frc.common;h=6066afbd5519c0a1a2bc693589e8427eea654183;hb=0d67238dc68a0d410c484064e2eccb1808df94ac;hp=667627862f08870b9f792ee2522d1663ca2ffe46;hpb=e69054f27759ba3fbc10434bc1de175fb676a0e6;p=openwrt-10.03%2F.git diff --git a/package/base-files/default/etc/rc.common b/package/base-files/default/etc/rc.common index 667627862..6066afbd5 100755 --- a/package/base-files/default/etc/rc.common +++ b/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,8 +54,8 @@ Available commands: stop Stop the service restart Restart the service reload Reload configuration files (or restart if that fails) - enable Enable the service (load at boot time) - disable Disable the service + enable Enable service autostart + disable Disable service autostart $EXTRA_HELP EOF } @@ -68,10 +74,10 @@ eval "case \"\$action\" in stop) stop;; reload) reload || restart;; restart) restart;; - enable) enable;; - disable) disable;; boot) boot;; shutdown) shutdown;; + enable) enable;; + disable) disable;; $cmds *) help;; esac"