@13902235969
2023-06-16T00:30:48.000000Z
字数 1371
阅读 115
#
#
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