This commit is contained in:
secXsQuared 2018-08-31 11:01:25 +08:00
parent f2a87d2826
commit f96f844fe2
1 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,48 @@
sudo yum -y update
./stop.sh
brook_ver=$(wget --no-check-certificate -qO- https://api.github.com/repos/txthinking/brook/releases | grep -o '"tag_name": ".*"' |head -n 1| sed 's/"//g' | sed 's/tag_name: //g')
new_brook_ver="Brook version "$(echo $brook_ver | sed 's/v//')
old_brook_ver=$(./brook -v)
echo "Current ver: $old_brook_ver. Latest ver: $new_brook_ver."
if [ "$new_brook_ver" != "$old_brook_ver" ]; then
echo Updating...
mv brook brook_bk
wget -q -N --no-check-certificate "https://github.com/txthinking/brook/releases/download/${brook_ver}/brook"
if [ ! -f ./brook ]; then
echo "Failed to download. Reverting..."
mv brook_bk brook
fi
chmod +x brook
fi
echo Starting...
./brook -v
# 2003: Peach
# 5800: Cheng F
# 5432: Cheng F Gay Friend
# 3306: Li Q
# 3389: Weilong
nohup ./brook servers \
-l ":5432 hahaha5432" \
-l ":2003 hahaha2003" \
-l ":3389 hahaha3389" \
-l ":5800 hahaha5800" \
-l ":3306 hahaha3306" \
-tcpDeadline 0 > brook_log.txt 2>brook_err.txt &