Skip to content

Commit

Permalink
# v1.0.4 修复 卸载Socat报错的问题。
Browse files Browse the repository at this point in the history
  • Loading branch information
Toyo authored Jul 24, 2017
1 parent adc9bbb commit 01f1e3d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions socat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export PATH
#=================================================
# System Required: Debian/Ubuntu
# Description: Socat
# Version: 1.0.3
# Version: 1.0.4
# Author: Toyo
# Blog: https://doub.io/wlzy-18/
#=================================================
Expand Down Expand Up @@ -297,7 +297,8 @@ uninstallSocat(){
stty erase '^H' && read -p "(默认: n):" unyn
[[ -z ${unyn} ]] && unyn="n"
if [[ ${unyn} == [Yy] ]]; then
kill -9 $(ps -ef | grep "socat" | grep -v grep | awk '{print $2}')
PID=$(ps -ef | grep "socat" | grep -v grep | grep -v ".sh" |awk '{print $2}')
[[ ! -z "${PID}" ]] && kill -9 "${PID}"
apt-get remove --purge socat -y
sed -i "/socat/d" /etc/rc.local
[[ -e ${socat_file} ]] && echo -e "${Error} Socat 卸载失败,请检查 !" && exit 1
Expand Down

0 comments on commit 01f1e3d

Please sign in to comment.