Skip to content

Commit

Permalink
fix: 修复入口设置
Browse files Browse the repository at this point in the history
  • Loading branch information
devhaozi committed Nov 9, 2023
1 parent 1bbec2b commit 8559fb9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/tools/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,11 @@ func UpdatePanel(panelInfo PanelInfo) error {
color.Greenln("文件校验完成")

color.Greenln("更新新版本...")
Exec("cd /www/panel && unzip -o " + panelInfo.DownloadName + " && rm -rf " + panelInfo.DownloadName + " && bash scripts/update_panel.sh")
Exec("cd /www/panel && unzip -o " + panelInfo.DownloadName + " && rm -rf " + panelInfo.DownloadName)
if !Exists("/www/panel/panel") {
return errors.New("更新失败,可能是下载过程中出现了问题")
}
Exec("bash /www/panel/scripts/update_panel.sh")
color.Greenln("更新完成")

color.Greenln("恢复面板配置...")
Expand Down
7 changes: 7 additions & 0 deletions scripts/update_panel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ if [ -z "$oldVersion" ]; then
echo "Error: can't get panel version"
exit 1
fi
# 判断版本号是否合法
versionPattern="^[0-9]+\.[0-9]+\.[0-9]+$"
if [[ ! $oldVersion =~ $versionPattern ]]; then
echo "错误:面板版本号不合法"
echo "Error: panel version is illegal"
exit 1
fi

echo $HR

Expand Down

0 comments on commit 8559fb9

Please sign in to comment.