更换库
This commit is contained in:
36
bin/kill.sh
Normal file
36
bin/kill.sh
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
init()
|
||||
{
|
||||
DB_PORT=$1
|
||||
}
|
||||
|
||||
|
||||
main()
|
||||
{
|
||||
PROCESS=`ps -axww | grep tunnel | grep ${DB_PORT} | grep "\-f" | awk '{print $1}'`
|
||||
if test "${PROCESS}" = ""; then
|
||||
echo "进程不存在!!!"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
echo "重启参数:" `./cmdline $PROCESS | sed "s|-f|-d -f|g"`
|
||||
|
||||
|
||||
echo "关闭进程: $PROCESS, 关闭端口: ${DB_PORT}"
|
||||
kill `ps -ax | grep tunnel | grep ${DB_PORT} | awk '{print $1}' | xargs `
|
||||
}
|
||||
|
||||
|
||||
if test "$1" = ""; then
|
||||
echo "参数错误!"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
init $1
|
||||
main
|
||||
|
||||
Reference in New Issue
Block a user