From 4e94a8314ebea52133542693650e00edbabbcd58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=8C=E6=A3=AE?= Date: Mon, 22 Jul 2024 18:13:22 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E8=A7=88=E7=89=88=E5=AE=89=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 萌森 --- apps/alist-aria2/data.yml | 2 +- apps/alist-ffmpeg/data.yml | 2 +- apps/elastic-elasticsearch/data.yml | 2 +- apps/elastic-kibana/data.yml | 2 +- script/local_app_uninstall.sh | 43 +++++++++++++++++++++++++++++ script/pre_app_install.sh | 4 +++ 6 files changed, 51 insertions(+), 4 deletions(-) create mode 100644 script/local_app_uninstall.sh diff --git a/apps/alist-aria2/data.yml b/apps/alist-aria2/data.yml index 65b5fc75..d3e1a642 100644 --- a/apps/alist-aria2/data.yml +++ b/apps/alist-aria2/data.yml @@ -2,7 +2,7 @@ name: Alist title: 文件列表程序 description: 一个支持多种存储的文件列表程序 additionalProperties: - key: alist + key: alist-aria2 name: Alist tags: - WebSite diff --git a/apps/alist-ffmpeg/data.yml b/apps/alist-ffmpeg/data.yml index 65b5fc75..3d9eb434 100644 --- a/apps/alist-ffmpeg/data.yml +++ b/apps/alist-ffmpeg/data.yml @@ -2,7 +2,7 @@ name: Alist title: 文件列表程序 description: 一个支持多种存储的文件列表程序 additionalProperties: - key: alist + key: alist-ffmpeg name: Alist tags: - WebSite diff --git a/apps/elastic-elasticsearch/data.yml b/apps/elastic-elasticsearch/data.yml index 0eb97e6a..52567cab 100644 --- a/apps/elastic-elasticsearch/data.yml +++ b/apps/elastic-elasticsearch/data.yml @@ -2,7 +2,7 @@ name: Elasticsearch title: 分布式、RESTful 风格的搜索和数据分析引擎 description: 分布式、RESTful 风格的搜索和数据分析引擎 additionalProperties: - key: elasticsearch + key: elastic-elasticsearch name: Elasticsearch tags: - Database diff --git a/apps/elastic-kibana/data.yml b/apps/elastic-kibana/data.yml index b425cfdc..e51bee2a 100644 --- a/apps/elastic-kibana/data.yml +++ b/apps/elastic-kibana/data.yml @@ -2,7 +2,7 @@ name: Kibana title: 基于浏览器的 Elasticsearch 分析和搜索仪表盘 description: 基于浏览器的 Elasticsearch 分析和搜索仪表盘 additionalProperties: - key: kibana + key: elastic-kibana name: Kibana tags: - WebSite diff --git a/script/local_app_uninstall.sh b/script/local_app_uninstall.sh new file mode 100644 index 00000000..19c36b95 --- /dev/null +++ b/script/local_app_uninstall.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +echo "$(date): Step Tip - Start installing the 1Panel third-party app store" +echo "$(date): Step Init - Checking for required commands..." + +check_command() { + command -v "$1" > /dev/null 2>&1 || { + echo >&2 "Error: $1 is not installed. Please install it and try again." + exit 1 + } +} + +check_command "git" +check_command "cp" +check_command "rm" +check_command "echo" +check_command "which" +check_command "xargs" +check_command "grep" +check_command "cut" + +BASE_DIR=$(which 1pctl | xargs grep '^BASE_DIR=' | cut -d'=' -f2) +echo "Step Init - 1panel install directory: $BASE_DIR" + +if [ -z "$BASE_DIR" ]; then + echo "Error: 1panel install directory not found." + exit 1 +fi + +LOCAL_DIR="$BASE_DIR/1panel/resource/apps/local" + +echo "$(date): Step 1 - Uninstalling applications..." +for app in "$LOCAL_DIR"/*; do + if [ -d "$app" ]; then + echo "$(date): Step 1 - Uninstalling $(basename "$app")..." + rm -rf "$app" + fi +done + +echo "$(date): Step Tip - Uninstalling the 1Panel third-party app store completed!" +echo "$(date): Step Tip - Copyright© 2024 Xinjiang Mengsen Software Development Studio." +echo "$(date): Step Tip - https://blog.lifebus.top/" +echo "$(date): Step Tip - Done!" diff --git a/script/pre_app_install.sh b/script/pre_app_install.sh index 945163dd..db7e3859 100644 --- a/script/pre_app_install.sh +++ b/script/pre_app_install.sh @@ -63,6 +63,10 @@ for app_directory in "${APPS_DIR:?}"/*; do echo "$(date): Step 2 - Installed applications $app_name" echo "$(date): Step 2 - Copied directory $app_directory to $LOCAL_DIR/" fi + + sed -i "s/^ key: ${app_name}/ key: ${app_name_pre}/g" "${LOCAL_DIR:?}/$app_name_pre/data.yml" + sed -i "/^name: /s/name: \(.*\)/name: \1 预览版/" "${LOCAL_DIR:?}/$app_name_pre/data.yml" + sed -i "/^ name: /s/ name: \(.*\)/ name: \1 预览版/" "${LOCAL_DIR:?}/$app_name_pre/data.yml" done echo "$(date): Step 3 - Copying envs directory..."