Update op.sh

This commit is contained in:
悟空的日常镜像仓库 2024-06-30 14:06:45 +08:00
parent 7a53ef985b
commit 6e1a0f25c9
1 changed files with 24 additions and 6 deletions

View File

@ -108,6 +108,7 @@ install_1panel_on_openwrt() {
}
# 安装istoreOS版本1panel
install_istorepanel() {
green "请务必确保您使用的是iStoreOS系统 回车或输入y来确定"
yellow "并且移除了之前安装过的通用版1panel容器(y|n)"
@ -130,10 +131,16 @@ install_istorepanel() {
echo "Failed to get Docker root directory."
exit 1
fi
if ! is_available_space_greater_than_2GB "$docker_root_dir"; then
red "检测到docker空间不足2GB 请在iStoreOS首页迁移docker到更大的分区"
exit 1
fi
# 去除末尾的 '/docker' 部分
config_root_dir=$(dirname "$docker_root_dir")
config_path="${config_root_dir}/Configs/1Panel"
green "是否将配置文件存放在$config_path 请输入y或回车来确定 n退出"
green "是否将配置文件存放在下面的目录"
yellow "$config_path"
cyan "请回车继续或者输入n退出"
read -r isConfig
if [ "$isConfig" = "y" ] || [ -z "$isConfig" ]; then
uci set istorepanel.@main[0].config_path=$config_path
@ -156,6 +163,17 @@ install_istorepanel() {
fi
}
is_available_space_greater_than_2GB() {
local dir_path=$1
local available_space_kb=$(df -k "$dir_path" | awk 'NR==2 {print $4}')
local available_space_gb=$((available_space_kb / 1024 / 1024))
if [ "$available_space_gb" -gt 2 ]; then
return 0
else
return 1
fi
}
# 倒计时15秒
countdown() {
local seconds=15
@ -266,12 +284,12 @@ while true; do
cyan " 1. 安装小雅tvbox"
echo " 2. 安装盒子助手docker版"
echo " 3. 安装AList docker版"
echo " 4. 安装1panel面板docker版"
cyan " 4. 安装1panel(iStoreOS版)"
echo " 5. 安装特斯拉伴侣TeslaMate"
echo " 6. 安装docker-compose"
echo " 7. 安装小雅全家桶Emby|Jellyfin"
echo " 8. 安装1panel(iStoreOS版)"
echo " U. 更新脚本"
echo " 8. 安装1panel面板通用版"
cyan " U. 更新脚本"
echo
echo " Q. 退出本程序"
echo
@ -289,7 +307,7 @@ while true; do
install_alist
;;
4)
install_1panel_on_openwrt
install_istorepanel
;;
5)
install_teslamate
@ -301,7 +319,7 @@ while true; do
install_xiaoya_allinone
;;
8)
install_istorepanel
install_1panel_on_openwrt
;;
u | U)
update_scripts