[关闭]
@13902235969 2023-06-16T00:30:48.000000Z 字数 1371 阅读 115

!/bin/bash

#

Dante Socks5 Server AutoInstall

-- Owner: https://www.inet.no/dante

-- Provider: https://sockd.info

-- Author: Lozy

#

Check if user is root

if [ $(id -u) != "0" ]; then
echo "Error: You must be root to run this script, please use root to install"
exit 1
fi

REQUEST_SERVER="https://raw.github.com/Lozy/danted/master"
SCRIPT_SERVER="https://public.sockd.info"
SYSTEM_RECOGNIZE=""

[ "1" == "--no-github" ] && REQUEST_SERVER={SCRIPT_SERVER}

if [ -s "/etc/os-release" ];then
os_name=$(sed -n 's/PRETTY_NAME="(.*)"/\1/p' /etc/os-release)

if [ -n "$(echo ${os_name} | grep -Ei 'Debian|Ubuntu' )" ];then
    printf "Current OS: %s\n" "${os_name}"
    SYSTEM_RECOGNIZE="debian"

elif [ -n "$(echo ${os_name} | grep -Ei 'CentOS')" ];then
    printf "Current OS: %s\n" "${os_name}"
        SYSTEM_RECOGNIZE="centos"
    else
        printf "Current OS: %s is not support.\n" "${os_name}"
fi

elif [ -s "/etc/issue" ];then
if [ -n "(grep -Ei 'CentOS' /etc/issue)"
SYSTEM_RECOGNIZE="centos"
else
printf "+++++++++++++++++++++++\n"
cat /etc/issue
printf "+++++++++++++++++++++++\n"
printf "[Error] Current OS: is not available to support.\n"
fi
else
printf "[Error] (/etc/os-release) OR (/etc/issue) not exist!\n"
printf "[Error] Current OS: is not available to support.\n"
fi

if [ -n "{REQUEST_SERVER}/install_* | tee /tmp/danted_install.log
else
printf "[Error] Installing terminated"
exit 1
fi

exit 0

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注