base-files: run readlink on initscript name before opening services
authorJohn Crispin <john@openwrt.org>
Thu, 11 Jul 2013 17:00:21 +0000 (17:00 +0000)
committerJohn Crispin <john@openwrt.org>
Thu, 11 Jul 2013 17:00:21 +0000 (17:00 +0000)
Signed-off-by: John Crispin <blogic@openwrt.org>
SVN-Revision: 37241

package/base-files/files/etc/rc.common

index 78e2dd49409db557a91ad6e386b5e29e4635bb16..aeec90c37ca5e22e64d579263a6beb9677808823 100755 (executable)
@@ -90,9 +90,9 @@ ${INIT_TRACE:+set -x}
 
 [ -n "$USE_PROCD" ] && {
        . $IPKG_INSTROOT/lib/functions/procd.sh
-
+       basescript=$(readlink "$initscript")
        rc_procd() {
-               procd_open_service "$(basename "$initscript")" "$initscript"
+               procd_open_service "$(basename ${basescript:-$initscript})" "$initscript"
                "$@"
                procd_close_service
        }
@@ -102,7 +102,7 @@ ${INIT_TRACE:+set -x}
        }
 
        stop() {
-               procd_kill "$(basename "$initscript")" "$1"
+               procd_kill "$(basename ${basescript:-$initscript})" "$1"
        }
 
        reload() {