Skip to content

Commit 7a9ec5a

Browse files
cqszhuangyangwhtiehack
authored andcommitted
fixed In the case of auto-restart, the status of checkPort is incorrect
The command is adjusted to "netstat -tlnp".
1 parent a75c0a5 commit 7a9ec5a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/pinus/lib/util/utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,9 @@ export function checkPort(app: Application, server: ServerInfo, cb: (result: str
219219
ssh_params = '';
220220
}
221221
if (!isLocal(host)) {
222-
cmd = util.format('ssh %s %s "netstat -an|awk \'{print $4}\'|grep %s|wc -l"', host, ssh_params, port);
222+
cmd = util.format('ssh %s %s "netstat -tlnp|awk \'{print $4}\'|grep %s|wc -l"', host, ssh_params, port);
223223
} else {
224-
cmd = util.format('netstat -an|awk \'{print $4}\'|grep %s|wc -l', port);
224+
cmd = util.format('netstat -tlnp|awk \'{print $4}\'|grep %s|wc -l', port);
225225
}
226226
return cmd;
227227
};
@@ -362,4 +362,4 @@ export function extendsObject(origin: any, add: any) {
362362
return origin;
363363
}
364364

365-
export let promisify = util.promisify;
365+
export let promisify = util.promisify;

0 commit comments

Comments
 (0)