将acme重命名方便区分,将自动化脚本的重复警告提取出来了,将bbr提取出来了,更改other的打印菜单方式

This commit is contained in:
lsy 2024-09-23 16:47:48 +08:00
parent debee99f00
commit 55e856934f
11 changed files with 35 additions and 50 deletions

View File

@ -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

View 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

View File

@ -8,10 +8,6 @@ declare aliyun_pick
declare ignore=1
if [[ -f "${path}/backup.sh" ]];then
echo "该路径文件已经存在"
fi
read -p "请输入数据目录,默认 /var/www " web_path
if [[ -z ${web_path} ]];then
web_path='/var/www'

View File

@ -5,9 +5,7 @@ if ! command -v docker &> /dev/null; then
echo "docker未安装"
exit
fi
if [[ -f "${path}/up-docker_compose.sh" ]];then
echo "该路径文件已经存在"
fi
declare web_path
read -p "请输入数据目录,默认 /var/www " web_path
if [[ -z ${web_path} ]];then

View File

@ -1,9 +1,5 @@
declare path="$1"
if [[ -f "${path}/update.sh" ]];then
echo "该路径文件已经存在"
fi
echo '#!/bin/bash' > "${path}/update.sh"
if [[ -f "/usr/bin/apt" ]];then

View File

@ -45,8 +45,8 @@ if [[ $pick =~ [1-"${#imags_dick[@]}"\ ] ]];then
elif [[ $pick =~ [1-$version_number] ]];then
version=${version_arr[$pick]}
fi
echo "bash <(curl -Ls ${server}) ${img} ${version}"
fi
eval "bash <(curl -Ls ${server}) ${img} ${version}"
else
echo "选择错误"
fi

10
Config/Other/bbr_open.sh Normal file
View 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 开启成功"

View File

@ -49,6 +49,10 @@ if [[ "$cron" == '* * * * * ' ]];then
exit
fi
if [[ -f "${path_script}/Config/Automation/${print_array[pick]}.sh" ]];then
echo "该路径文件已经存在"
fi
bash "${path_script}/Config/Automation/${print_array[pick]}.sh" "$path"
chmod +x "${path}/${print_array[pick]}.sh"

View File

@ -1,33 +1,18 @@
declare pick
declare path_script=$1
declare file_name=$(basename $0)
echo "========Other========"
echo "1.开启BBR"
echo "2.更换系统语言"
echo "3.申请SSL证书"
echo "4.一键DD/重装脚本"
declare print_number=0
declare -a print_arr
declare pick
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 "========Other========"
read -p "请输入:" pick
case "$pick" in
'1')
declare version=$(uname -r | awk -F "." '{print $1}')
if ! [[ $version -ge 5 ]];then
echo "系统内核版本过低"
exit
if [[ $pick =~ [1-$print_number] ]]; then
bash "${path_script}/Config/${file_name}/${print_arr[$pick]}.sh"
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