Support CentOS 7
This commit is contained in:
parent
4c8bf87c13
commit
890013cd93
|
|
@ -18,17 +18,6 @@ echo "#"
|
||||||
echo "#############################################################"
|
echo "#############################################################"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Install Shadowsocks-libev
|
|
||||||
function install_shadowsocks_libev(){
|
|
||||||
rootness
|
|
||||||
disable_selinux
|
|
||||||
pre_install
|
|
||||||
download_files
|
|
||||||
config_shadowsocks
|
|
||||||
iptables_set
|
|
||||||
install
|
|
||||||
}
|
|
||||||
|
|
||||||
# Make sure only root can run our script
|
# Make sure only root can run our script
|
||||||
function rootness(){
|
function rootness(){
|
||||||
if [[ $EUID -ne 0 ]]; then
|
if [[ $EUID -ne 0 ]]; then
|
||||||
|
|
@ -68,12 +57,9 @@ fi
|
||||||
|
|
||||||
# Pre-installation settings
|
# Pre-installation settings
|
||||||
function pre_install(){
|
function pre_install(){
|
||||||
# Not support CentOS 5.x and 7.x
|
# Not support CentOS 5
|
||||||
if centosversion 5; then
|
if centosversion 5; then
|
||||||
echo "Not support CentOS 5.x, please change to CentOS 6.x and try again."
|
echo "Not support CentOS 5, please change to CentOS 6 or 7 and try again."
|
||||||
exit 1
|
|
||||||
elif centosversion 7; then
|
|
||||||
echo "Not support CentOS 7.x, please change to CentOS 6.x and try again."
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
#Set shadowsocks-libev config password
|
#Set shadowsocks-libev config password
|
||||||
|
|
@ -105,6 +91,8 @@ function pre_install(){
|
||||||
if [ -z $IP ]; then
|
if [ -z $IP ]; then
|
||||||
IP=`curl -s ifconfig.me/ip`
|
IP=`curl -s ifconfig.me/ip`
|
||||||
fi
|
fi
|
||||||
|
echo -e "Your main public IP is\t\033[32m$IP\033[0m"
|
||||||
|
echo ""
|
||||||
#Current folder
|
#Current folder
|
||||||
cur_dir=`pwd`
|
cur_dir=`pwd`
|
||||||
cd $cur_dir
|
cd $cur_dir
|
||||||
|
|
@ -166,7 +154,6 @@ function iptables_set(){
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Install
|
# Install
|
||||||
function install(){
|
function install(){
|
||||||
# Build and Install shadowsocks-libev
|
# Build and Install shadowsocks-libev
|
||||||
|
|
@ -249,6 +236,19 @@ function uninstall_shadowsocks_libev(){
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Install Shadowsocks-libev
|
||||||
|
function install_shadowsocks_libev(){
|
||||||
|
rootness
|
||||||
|
disable_selinux
|
||||||
|
pre_install
|
||||||
|
download_files
|
||||||
|
config_shadowsocks
|
||||||
|
if ! centosversion 7; then
|
||||||
|
iptables_set
|
||||||
|
fi
|
||||||
|
install
|
||||||
|
}
|
||||||
|
|
||||||
# Initialization step
|
# Initialization step
|
||||||
action=$1
|
action=$1
|
||||||
[ -z $1 ] && action=install
|
[ -z $1 ] && action=install
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user