update comment
This commit is contained in:
parent
860ad4b424
commit
b3a59807d0
21
haproxy.sh
21
haproxy.sh
|
|
@ -53,8 +53,8 @@ disable_selinux(){
|
||||||
}
|
}
|
||||||
|
|
||||||
valid_ip(){
|
valid_ip(){
|
||||||
local ip=$1
|
local ip=$1
|
||||||
local stat=1
|
local stat=1
|
||||||
if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
|
if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
|
||||||
OIFS=$IFS
|
OIFS=$IFS
|
||||||
IFS='.'
|
IFS='.'
|
||||||
|
|
@ -84,17 +84,17 @@ function pre_install(){
|
||||||
expr ${haproxyport} + 0 &>/dev/null
|
expr ${haproxyport} + 0 &>/dev/null
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
if [ ${haproxyport} -ge 1 ] && [ ${haproxyport} -le 65535 ]; then
|
if [ ${haproxyport} -ge 1 ] && [ ${haproxyport} -le 65535 ]; then
|
||||||
echo ""
|
echo
|
||||||
echo "---------------------------"
|
echo "---------------------------"
|
||||||
echo "port = ${haproxyport}"
|
echo "port = ${haproxyport}"
|
||||||
echo "---------------------------"
|
echo "---------------------------"
|
||||||
echo ""
|
echo
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
echo "Input error! Please input correct numbers."
|
echo "Input error! Please input correct number."
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "Input error! Please input correct numbers."
|
echo "Input error! Please input correct number."
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
@ -105,11 +105,11 @@ function pre_install(){
|
||||||
read -p "(IPv4 is):" haproxyip
|
read -p "(IPv4 is):" haproxyip
|
||||||
valid_ip ${haproxyip}
|
valid_ip ${haproxyip}
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo ""
|
echo
|
||||||
echo "---------------------------"
|
echo "---------------------------"
|
||||||
echo "IP = ${haproxyip}"
|
echo "IP = ${haproxyip}"
|
||||||
echo "---------------------------"
|
echo "---------------------------"
|
||||||
echo ""
|
echo
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
echo "Input error! Please input correct IPv4 address."
|
echo "Input error! Please input correct IPv4 address."
|
||||||
|
|
@ -125,7 +125,7 @@ function pre_install(){
|
||||||
stty echo
|
stty echo
|
||||||
stty $SAVEDSTTY
|
stty $SAVEDSTTY
|
||||||
}
|
}
|
||||||
echo ""
|
echo
|
||||||
echo "Press any key to start...or Press Ctrl+C to cancel"
|
echo "Press any key to start...or Press Ctrl+C to cancel"
|
||||||
char=`get_char`
|
char=`get_char`
|
||||||
|
|
||||||
|
|
@ -201,7 +201,7 @@ install(){
|
||||||
echo "haproxy start failure..."
|
echo "haproxy start failure..."
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo ""
|
echo
|
||||||
echo "haproxy install failed."
|
echo "haproxy install failed."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
@ -220,7 +220,6 @@ install(){
|
||||||
echo "Welcome to visit:https://shadowsocks.be/10.html"
|
echo "Welcome to visit:https://shadowsocks.be/10.html"
|
||||||
echo "Enjoy it."
|
echo "Enjoy it."
|
||||||
echo
|
echo
|
||||||
exit 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user