diff --git a/plugin/shadowsocks/service.coffee b/plugin/shadowsocks/service.coffee index 55fff72..9af7df4 100644 --- a/plugin/shadowsocks/service.coffee +++ b/plugin/shadowsocks/service.coffee @@ -33,16 +33,19 @@ queryIptablesInfo = (callback) -> for item in lines if is_chain_output if item - [num, pkts, bytes, prot, opt, in_, out, source, destination, prot, port] = item.split /\s+/ + try + [num, pkts, bytes, prot, opt, in_, out, source, destination, prot, port] = item.split /\s+/ - unless num == 'num' - port = port.match(/spt:(\d+)/)[1] + unless num == 'num' + port = port.match(/spt:(\d+)/)[1] - iptables_info[port.toString()] = - num: parseInt num - pkts: parseInt pkts - bytes: parseInt bytes - port: parseInt port + iptables_info[port.toString()] = + num: parseInt num + pkts: parseInt pkts + bytes: parseInt bytes + port: parseInt + catch e + continue if item[0...CHAIN_OUTPUT.length] == CHAIN_OUTPUT is_chain_output = true diff --git a/sample/shadowsocks.config.coffee b/sample/shadowsocks.config.coffee index 8602315..24d4dba 100644 --- a/sample/shadowsocks.config.coffee +++ b/sample/shadowsocks.config.coffee @@ -17,7 +17,7 @@ module.exports = available_services: ['shadowsocks'] billing: - taobao_item_id: '38370649858' + taobao_item_id: '40711140727' force_unsubscribe: when_balance_below: 0