modules/admin-full: hide system software tab if opkg is not present
authorJo-Philipp Wich <jow@openwrt.org>
Sat, 8 Oct 2011 21:43:50 +0000 (21:43 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sat, 8 Oct 2011 21:43:50 +0000 (21:43 +0000)
modules/admin-full/luasrc/controller/admin/system.lua

index abfe1f5f164c907ea4b2372742c22e4c3d54b9c7..f5b6b1493c58992d0d16f3554d3f1fe072b0926d 100644 (file)
@@ -19,8 +19,12 @@ function index()
        entry({"admin", "system"}, alias("admin", "system", "system"), _("System"), 30).index = true
        entry({"admin", "system", "system"}, cbi("admin_system/system"), _("System"), 1)
        entry({"admin", "system", "admin"}, cbi("admin_system/admin"), _("Administration"), 2)
-       entry({"admin", "system", "packages"}, call("action_packages"), _("Software"), 10)
-       entry({"admin", "system", "packages", "ipkg"}, form("admin_system/ipkg"))
+
+       if nixio.fs.access("/bin/opkg") then
+               entry({"admin", "system", "packages"}, call("action_packages"), _("Software"), 10)
+               entry({"admin", "system", "packages", "ipkg"}, form("admin_system/ipkg"))
+       end
+
        entry({"admin", "system", "startup"}, form("admin_system/startup"), _("Startup"), 45)
 
        if nixio.fs.access("/etc/config/fstab") then