summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-dockerman
diff options
context:
space:
mode:
authorPaul Spooren <mail@aparcar.org>2020-08-09 13:42:09 -1000
committerPaul Spooren <mail@aparcar.org>2020-08-20 15:54:54 -1000
commitc4a4e43e2e97065dcda53c9ac7ee49c05171dbd8 (patch)
tree5f2e877793a63c9e639410ce868d2f755f5db695 /applications/luci-app-dockerman
parent03253c23090a9928c15ab8d80c18b734e3e814ed (diff)
treewide: replace `which` with `command -v`
Fix shellcheck SC2230 > which is non-standard. Use builtin 'command -v' instead. Once applied to everything concerning OpenWrt we can disable the busybox feature `which` and save 3.8kB. Signed-off-by: Paul Spooren <mail@aparcar.org>
Diffstat (limited to 'applications/luci-app-dockerman')
-rw-r--r--applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua b/applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua
index 37be23e0d..ec3f9201a 100644
--- a/applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua
+++ b/applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua
@@ -664,8 +664,8 @@ elseif action == "logs" then
elseif action == "console" then
m.submit = false
m.reset = false
- local cmd_docker = luci.util.exec("which docker"):match("^.+docker") or nil
- local cmd_ttyd = luci.util.exec("which ttyd"):match("^.+ttyd") or nil
+ local cmd_docker = luci.util.exec("command -v docker"):match("^.+docker") or nil
+ local cmd_ttyd = luci.util.exec("command -v ttyd"):match("^.+ttyd") or nil
if cmd_docker and cmd_ttyd and container_info.State.Status == "running" then
local cmd = "/bin/sh"
@@ -697,8 +697,8 @@ elseif action == "console" then
Button.render(self, section, scope)
end
o.write = function(self, section)
- local cmd_docker = luci.util.exec("which docker"):match("^.+docker") or nil
- local cmd_ttyd = luci.util.exec("which ttyd"):match("^.+ttyd") or nil
+ local cmd_docker = luci.util.exec("command -v docker"):match("^.+docker") or nil
+ local cmd_ttyd = luci.util.exec("command -v ttyd"):match("^.+ttyd") or nil
if not cmd_docker or not cmd_ttyd or cmd_docker:match("^%s+$") or cmd_ttyd:match("^%s+$")then
return