parent
58e2f471be
commit
337a6ace91
@ -1,6 +1,7 @@ |
||||
#!/bin/sh |
||||
# 查找端口pid |
||||
if [[ $# == 1 && `netstat -antp|grep $1|wc -l` -eq 1 ]] |
||||
port=`netstat -antpl|grep $1|awk '{printf $7}'|cut -d/ -f1` |
||||
if [[ $# == 1 && `echo $port|wc -l` -eq 1 ]] |
||||
then |
||||
netstat -anp|grep $1|awk '{printf $7}'|cut -d/ -f1 |
||||
echo $port |
||||
fi |
||||
|
Loading…
Reference in new issue