diff options
author | Jo-Philipp Wich <jo@mein.io> | 2022-10-20 10:13:38 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2022-10-20 10:13:38 +0200 |
commit | 74283264a34083725a71a0f62de423a514efa402 (patch) | |
tree | 34fdc81aade8a7ea4192ce1d807a0e181301ade3 /applications/luci-app-ddns/root/usr/libexec | |
parent | 3395656b9f687fd5e071a7805e0ba4c83f62906d (diff) |
luci-app-ddns: gracefully handle missing control file
In case `pcall()` fails, `ctrl` will contain an error message.
Fixes: 3395656b9f ("luci-app-ddns: get rid of luci-lib-ipkg depdency")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'applications/luci-app-ddns/root/usr/libexec')
-rwxr-xr-x | applications/luci-app-ddns/root/usr/libexec/rpcd/luci.ddns | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/applications/luci-app-ddns/root/usr/libexec/rpcd/luci.ddns b/applications/luci-app-ddns/root/usr/libexec/rpcd/luci.ddns index 6db329c186..b2e60cb3c2 100755 --- a/applications/luci-app-ddns/root/usr/libexec/rpcd/luci.ddns +++ b/applications/luci-app-ddns/root/usr/libexec/rpcd/luci.ddns @@ -160,8 +160,8 @@ local methods = { local res = {} local ver - local _, ctrl = pcall(io.lines, "/usr/lib/opkg/info/%s.control" % srv_name) - if ctrl then + local ok, ctrl = pcall(io.lines, "/usr/lib/opkg/info/%s.control" % srv_name) + if ok then for line in ctrl do ver = line:match("^Version: (.+)$") |