diff --git a/.sshelp.swp b/.sshelp.swp new file mode 100644 index 0000000..ce84829 Binary files /dev/null and b/.sshelp.swp differ diff --git a/ss-fly.sh b/ss-fly.sh index f087061..27fc372 100755 --- a/ss-fly.sh +++ b/ss-fly.sh @@ -69,7 +69,7 @@ uninstall_ss() { ssserver -c /etc/shadowsocks.json -d stop fi case $os in - 'ubuntu') + 'ubuntu'|'debian') update-rc.d -f ss-fly remove ;; 'centos') @@ -148,7 +148,7 @@ install_ssr() { ./shadowsocksR.sh 2>&1 | tee shadowsocksR.log } -check_os() { +check_os_() { source /etc/os-release local os_tmp=$(echo $ID | tr [A-Z] [a-z]) case $os_tmp in @@ -165,6 +165,24 @@ check_os() { esac } +check_os() { + if [[ -f /etc/redhat-release ]]; then + os="centos" + elif cat /etc/issue | grep -Eqi "debian"; then + os="debian" + elif cat /etc/issue | grep -Eqi "ubuntu"; then + os="ubuntu" + elif cat /etc/issue | grep -Eqi "centos|red hat|redhat"; then + os="centos" + elif cat /proc/version | grep -Eqi "debian"; then + os="debian" + elif cat /proc/version | grep -Eqi "ubuntu"; then + os="ubuntu" + elif cat /proc/version | grep -Eqi "centos|red hat|redhat"; then + os="centos" + fi +} + check_bbr_status() { local param=$(sysctl net.ipv4.tcp_available_congestion_control | awk '{print $3}') if [[ x"${param}" == x"bbr" ]]; then @@ -247,7 +265,7 @@ kern=$( uname -r ) check_dependency() { case $os in - 'ubuntu') + 'ubuntu'|'debian') apt-get -y update apt-get -y install python python-dev python-setuptools openssl libssl-dev curl wget unzip gcc automake autoconf make libtool ;; @@ -401,7 +419,7 @@ install() { cp $fly_dir/ss-fly /etc/init.d/ chmod +x /etc/init.d/ss-fly case $os in - 'ubuntu') + 'ubuntu'|'debian') update-rc.d ss-fly defaults ;; 'centos')