libs/sys: fix luci.sys.init.index() (#399)
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 6 May 2012 09:47:57 +0000 (09:47 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 6 May 2012 09:47:57 +0000 (09:47 +0000)
libs/sys/luasrc/sys.lua

index 7906d2be2cb07dda75cf44507cc5f8bad9874466..54f7f2b1a97cf858d200c02fed0630f48bacbb0e 100644 (file)
@@ -795,7 +795,7 @@ end
 -- @return             Numeric index value
 function init.index(name)
        if fs.access(init.dir..name) then
-               return call("env -i sh -c 'source %s%s; exit $START' >/dev/null"
+               return call("env -i sh -c 'source %s%s enabled; exit ${START:-255}' >/dev/null"
                        %{ init.dir, name })
        end
 end