v2ee - 检测端口
type: channel
link: https://www.v2ee.top/tag/%E6%A3%80%E6%B5%8B%E7%AB%AF%E5%8F%A3/
items: shell脚本检测端口是否被占用

shell脚本检测端口是否被占用
type: item
date: 2018-02-27T07:46:00+00:00
description: check_port() { echo "Checking instance port ..." netstat -tlpn | grep "\b$1\b" } if check_port 8080 then echo "port exists" exit 1 fi