From 0aacabff0bff941313a6d25604616c348efe1e57 Mon Sep 17 00:00:00 2001 From: Jian Chang Date: Sun, 10 Apr 2016 19:24:19 +0800 Subject: [PATCH] fixes #27 --- files/luci/model/cbi/shadowsocks.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/files/luci/model/cbi/shadowsocks.lua b/files/luci/model/cbi/shadowsocks.lua index 81614d7..ef137f1 100644 --- a/files/luci/model/cbi/shadowsocks.lua +++ b/files/luci/model/cbi/shadowsocks.lua @@ -26,7 +26,7 @@ end function get_version() local version = "1.0.0-1" - ipkg.list_installed("shadowsocks-libev-spec", function(n, v, d) + ipkg.list_installed("shadowsocks-libev-spec*", function(n, v, d) pkg_name = n version = v end) @@ -43,8 +43,11 @@ function compare_versions(ver1, comp, ver2) end if compare_versions(min_version, ">>", get_version()) then - return Map(shadowsocks, translate("ShadowSocks"), - 'Please update the packages: %s' %{pkg_name}) + local tip = 'shadowsocks-libev-spec not found' + if pkg_name then + tip = 'Please update the packages: %s' %{pkg_name} + end + return Map(shadowsocks, translate("ShadowSocks"), '%s' %{tip}) end local chnroute = uci:get_first("chinadns", "chinadns", "chnroute")