feat(脚本): 添加hysteria管理

pull/578/head
mack-a 2023-03-01 17:17:40 +08:00
parent a070373478
commit 04a8e7e2f3
1 changed files with 31 additions and 4 deletions

View File

@ -5501,7 +5501,7 @@ manageHysteria() {
if [[ -n "${hysteriaConfigPath}" ]]; then if [[ -n "${hysteriaConfigPath}" ]]; then
echoContent yellow "1.重新安装" echoContent yellow "1.重新安装"
echoContent yellow "2.卸载" echoContent yellow "2.卸载"
echoContent yellow "3.更新core" echoContent yellow "3.core管理"
echoContent yellow "4.查看日志" echoContent yellow "4.查看日志"
hysteriaStatus=true hysteriaStatus=true
else else
@ -5515,18 +5515,45 @@ manageHysteria() {
elif [[ "${installHysteriaStatus}" == "2" && "${hysteriaStatus}" == "true" ]]; then elif [[ "${installHysteriaStatus}" == "2" && "${hysteriaStatus}" == "true" ]]; then
unInstallHysteriaCore unInstallHysteriaCore
elif [[ "${installHysteriaStatus}" == "3" && "${hysteriaStatus}" == "true" ]]; then elif [[ "${installHysteriaStatus}" == "3" && "${hysteriaStatus}" == "true" ]]; then
installHysteria 1 hysteriaVersionManageMenu 1
handleHysteria start
elif [[ "${installHysteriaStatus}" == "4" && "${hysteriaStatus}" == "true" ]]; then elif [[ "${installHysteriaStatus}" == "4" && "${hysteriaStatus}" == "true" ]]; then
journalctl -fu hysteria journalctl -fu hysteria
fi fi
} }
# hysteria版本管理
hysteriaVersionManageMenu() {
echoContent skyBlue "\n进度 $1/${totalProgress} : Hysteria版本管理"
if [[ ! -d "/etc/v2ray-agent/hysteria/" ]]; then
echoContent red " ---> 没有检测到安装目录,请执行脚本安装内容"
menu
exit 0
fi
echoContent red "\n=============================================================="
echoContent yellow "1.升级Hysteria"
echoContent yellow "2.关闭Hysteria"
echoContent yellow "3.打开Hysteria"
echoContent yellow "4.重启Hysteria"
echoContent red "=============================================================="
read -r -p "请选择:" selectHysteriaType
if [[ "${selectHysteriaType}" == "1" ]]; then
installHysteria 1
handleHysteria start
elif [[ "${selectHysteriaType}" == "2" ]]; then
handleHysteria stop
elif [[ "${selectHysteriaType}" == "3" ]]; then
handleHysteria start
elif [[ "${selectHysteriaType}" == "4" ]]; then
handleHysteria stop
handleHysteria start
fi
}
# 主菜单 # 主菜单
menu() { menu() {
cd "$HOME" || exit cd "$HOME" || exit
echoContent red "\n==============================================================" echoContent red "\n=============================================================="
echoContent green "作者:mack-a" echoContent green "作者:mack-a"
echoContent green "当前版本:v2.7.6" echoContent green "当前版本:v2.7.7"
echoContent green "Github:https://github.com/mack-a/v2ray-agent" echoContent green "Github:https://github.com/mack-a/v2ray-agent"
echoContent green "描述:八合一共存脚本\c" echoContent green "描述:八合一共存脚本\c"
showInstallStatus showInstallStatus