stopsocks.in
资源名称:socks5.zip [点击查看]
上传用户:sddyfurun
上传日期:2007-01-04
资源大小:525k
文件大小:1k
源码类别:
代理服务器
开发平台:
Unix_Linux
- #!/bin/sh
- KILL=kill
- PORT=@SOCKS_DEFAULT_PORT@
- PIDFILE=${SOCKS5_PIDFILE-@SRVPID_FILE@}
- if [ "$#" != "0" ] ; then
- if [ "$1" = "-p" ] ; then
- if [ "$#" != "1" ] ; then
- shift
- PORT=$1
- shift
- fi
- fi
- fi
- if [ -z "$PORT" ] ; then
- FILE=${PIDFILE}-1080
- else
- FILE=${PIDFILE}-$PORT
- fi
- if [ ! -f "$FILE" -a "$#" != "2" ] ; then
- echo "PID file $FILE does not exist"
- exit
- fi
- case $# in
- 0)
- SIGNAL=-HUP
- PID=`cat $FILE`
- ;;
- 1) SIGNAL=$1
- PID=`cat $FILE`
- ;;
- 2) SIGNAL=$1
- PID=$2
- ;;
- *)
- echo "usage: $0 [-p port] [signal] [pid]"
- exit 1;
- ;;
- esac
- case "$SIGNAL" in
- '-HUP')
- ${KILL} -HUP ${PID}
- ;;
- '-1')
- ${KILL} -1 ${PID}
- ;;
- *)
- ${KILL} ${SIGNAL} -${PID}
- rm $FILE
- ;;
- esac