1
0
Fork 0

Create update_local_appstore.sh

This commit is contained in:
pooneyy 2025-06-18 14:29:39 +08:00
commit ca87a72d3f
No known key found for this signature in database
1 changed files with 41 additions and 0 deletions

41
update_local_appstore.sh Normal file
View File

@ -0,0 +1,41 @@
check_command() {
command -v "$1" > /dev/null 2>&1 || {
echo >&2 "未找到 $1 命令"
exit 1
}
}
check_command "cp"
check_command "cut"
check_command "git"
check_command "grep"
check_command "rm"
check_command "which"
check_command "xargs"
BASE_DIR=$(which 1pctl | xargs grep '^BASE_DIR=' | cut -d'=' -f2)
if [ -z "$BASE_DIR" ]; then
echo "未找到 1panel 的安装路径"
exit 1
fi
TEMP_DIR="/tmp/localApps"
repo_prefixs=(
'https://github.com'
'https://kkgithub.com'
'https://wget.la/https://github.com'
'https://ghfast.top/https://github.com'
'https://githubfast.com'
'https://ghproxy.net/https://github.com'
)
repo_suffix="/pooneyy/1Panel-Appstore.git"
for repo_prefix in "${repo_prefixs[@]}"; do
git clone --depth 1 -b localApps $repo_prefix$repo_suffix $TEMP_DIR && break
done
cp -rf $TEMP_DIR/apps/* $BASE_DIR/1panel/resource/apps/local/
rm -rf $TEMP_DIR