将acme重命名方便区分,将自动化脚本的重复警告提取出来了,将bbr提取出来了,更改other的打印菜单方式
This commit is contained in:
parent
debee99f00
commit
55e856934f
@ -1,11 +0,0 @@
|
|||||||
declare path="$1"
|
|
||||||
|
|
||||||
if [[ -f "${path}/acme.sh" ]];then
|
|
||||||
echo "该路径文件已经存在"
|
|
||||||
fi
|
|
||||||
|
|
||||||
cat > "${path}/acme.sh" << EOF
|
|
||||||
#!/bin/bash
|
|
||||||
${HOME}/.acme.sh/acme.sh --upgrade
|
|
||||||
${HOME}/.acme.sh/acme.sh --renew-all
|
|
||||||
EOF
|
|
7
Config/Automation/acme_update.sh
Normal file
7
Config/Automation/acme_update.sh
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
declare path="$1"
|
||||||
|
|
||||||
|
cat > "${path}/acme_update.sh" << EOF
|
||||||
|
#!/bin/bash
|
||||||
|
${HOME}/.acme.sh/acme.sh --upgrade
|
||||||
|
${HOME}/.acme.sh/acme.sh --renew-all
|
||||||
|
EOF
|
@ -8,10 +8,6 @@ declare aliyun_pick
|
|||||||
declare ignore=1
|
declare ignore=1
|
||||||
|
|
||||||
|
|
||||||
if [[ -f "${path}/backup.sh" ]];then
|
|
||||||
echo "该路径文件已经存在"
|
|
||||||
fi
|
|
||||||
|
|
||||||
read -p "请输入数据目录,默认 /var/www :" web_path
|
read -p "请输入数据目录,默认 /var/www :" web_path
|
||||||
if [[ -z ${web_path} ]];then
|
if [[ -z ${web_path} ]];then
|
||||||
web_path='/var/www'
|
web_path='/var/www'
|
||||||
|
@ -5,9 +5,7 @@ if ! command -v docker &> /dev/null; then
|
|||||||
echo "docker未安装"
|
echo "docker未安装"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
if [[ -f "${path}/up-docker_compose.sh" ]];then
|
|
||||||
echo "该路径文件已经存在"
|
|
||||||
fi
|
|
||||||
declare web_path
|
declare web_path
|
||||||
read -p "请输入数据目录,默认 /var/www :" web_path
|
read -p "请输入数据目录,默认 /var/www :" web_path
|
||||||
if [[ -z ${web_path} ]];then
|
if [[ -z ${web_path} ]];then
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
declare path="$1"
|
declare path="$1"
|
||||||
|
|
||||||
if [[ -f "${path}/update.sh" ]];then
|
|
||||||
echo "该路径文件已经存在"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo '#!/bin/bash' > "${path}/update.sh"
|
echo '#!/bin/bash' > "${path}/update.sh"
|
||||||
|
|
||||||
if [[ -f "/usr/bin/apt" ]];then
|
if [[ -f "/usr/bin/apt" ]];then
|
||||||
|
@ -45,8 +45,8 @@ if [[ $pick =~ [1-"${#imags_dick[@]}"\ ] ]];then
|
|||||||
elif [[ $pick =~ [1-$version_number] ]];then
|
elif [[ $pick =~ [1-$version_number] ]];then
|
||||||
version=${version_arr[$pick]}
|
version=${version_arr[$pick]}
|
||||||
fi
|
fi
|
||||||
echo "bash <(curl -Ls ${server}) ${img} ${version}"
|
|
||||||
fi
|
fi
|
||||||
|
eval "bash <(curl -Ls ${server}) ${img} ${version}"
|
||||||
else
|
else
|
||||||
echo "选择错误"
|
echo "选择错误"
|
||||||
fi
|
fi
|
10
Config/Other/bbr_open.sh
Normal file
10
Config/Other/bbr_open.sh
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
declare version=$(uname -r | awk -F "." '{print $1}')
|
||||||
|
if ! [[ $version -ge 5 ]];then
|
||||||
|
echo "系统内核版本过低"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
grep -q "net.core.default_qdisc=fq" "/etc/sysctl.conf" || echo 'net.core.default_qdisc=fq' | sudo tee -a "/etc/sysctl.conf"
|
||||||
|
grep -q "net.ipv4.tcp_congestion_control=bbr" "/etc/sysctl.conf" || echo 'net.ipv4.tcp_congestion_control=bbr' | sudo tee -a "/etc/sysctl.conf"
|
||||||
|
sudo sysctl -p || echo "bbr 开启失败"
|
||||||
|
sysctl net.ipv4.tcp_available_congestion_control | grep bbr && echo "bbr 开启成功"
|
@ -49,6 +49,10 @@ if [[ "$cron" == '* * * * * ' ]];then
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -f "${path_script}/Config/Automation/${print_array[pick]}.sh" ]];then
|
||||||
|
echo "该路径文件已经存在"
|
||||||
|
fi
|
||||||
|
|
||||||
bash "${path_script}/Config/Automation/${print_array[pick]}.sh" "$path"
|
bash "${path_script}/Config/Automation/${print_array[pick]}.sh" "$path"
|
||||||
|
|
||||||
chmod +x "${path}/${print_array[pick]}.sh"
|
chmod +x "${path}/${print_array[pick]}.sh"
|
||||||
|
@ -1,33 +1,18 @@
|
|||||||
declare pick
|
|
||||||
declare path_script=$1
|
declare path_script=$1
|
||||||
|
declare file_name=$(basename $0)
|
||||||
echo "========Other========"
|
echo "========Other========"
|
||||||
echo "1.开启BBR"
|
declare print_number=0
|
||||||
echo "2.更换系统语言"
|
declare -a print_arr
|
||||||
echo "3.申请SSL证书"
|
declare pick
|
||||||
echo "4.一键DD/重装脚本"
|
for i in "${path_script}/Config/${file_name}"/* ; do
|
||||||
|
print_number=$(( print_number+1 ))
|
||||||
|
print_arr[$print_number]=$(basename $i)
|
||||||
|
echo "${print_number}.${i}"
|
||||||
|
done
|
||||||
echo "输入其他任意返回主页"
|
echo "输入其他任意返回主页"
|
||||||
echo "========Other========"
|
echo "========Other========"
|
||||||
read -p "请输入:" pick
|
read -p "请输入:" pick
|
||||||
|
|
||||||
case "$pick" in
|
if [[ $pick =~ [1-$print_number] ]]; then
|
||||||
'1')
|
bash "${path_script}/Config/${file_name}/${print_arr[$pick]}.sh"
|
||||||
declare version=$(uname -r | awk -F "." '{print $1}')
|
fi
|
||||||
if ! [[ $version -ge 5 ]];then
|
|
||||||
echo "系统内核版本过低"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
grep -q "net.core.default_qdisc=fq" "/etc/sysctl.conf" || echo 'net.core.default_qdisc=fq' | sudo tee -a "/etc/sysctl.conf"
|
|
||||||
grep -q "net.ipv4.tcp_congestion_control=bbr" "/etc/sysctl.conf" || echo 'net.ipv4.tcp_congestion_control=bbr' | sudo tee -a "/etc/sysctl.conf"
|
|
||||||
sudo sysctl -p || echo "bbr 开启失败"
|
|
||||||
sysctl net.ipv4.tcp_available_congestion_control | grep bbr && echo "bbr 开启成功"
|
|
||||||
;;
|
|
||||||
'2')
|
|
||||||
bash "${path_script}/Config/Other/Language.sh"
|
|
||||||
;;
|
|
||||||
'3')
|
|
||||||
bash "${path_script}/Config/Other/Acme.sh"
|
|
||||||
;;
|
|
||||||
'4')
|
|
||||||
bash "${path_script}/Config/Other/Reinstall.sh"
|
|
||||||
;;
|
|
||||||
esac
|
|
Loading…
Reference in New Issue
Block a user