Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gyteng committed Feb 27, 2019
1 parent 5589b18 commit a47c81d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "shadowsocks-manager-wireguard",
"version": "0.31.0",
"version": "0.31.3",
"description": "",
"main": "index.js",
"author": "Gu Yuteng <[email protected]>",
Expand Down
3 changes: 3 additions & 0 deletions wireguard.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ const getClientIp = async port => {
}
const result = await runCommand(`wg show ${ interface } dump | grep ${ account }`);
const client = result.split(/\s/)[2];
if(client.trim() === '(none)') {
return Promise.resolve([]);
}
return Promise.resolve([ client.split(':')[0] ]);
};

Expand Down

0 comments on commit a47c81d

Please sign in to comment.