Skip to content

Commit fe1bf03

Browse files
authored
fix(script/v4.sh) 为命令返回添加按任意键继续 (#9)
* feat(script/v4.sh): Update script for all supported architectures and Linux check * fix(script/v4.sh): update script version and architecture info * build: update script version to 1.3.2 * feat(script/v4.sh): add key press prompt in RESET_PASSWORD function * refactor(script/v4.sh): Remove redundant sleep and add key press to continue * refactor(script/v4.sh): Remove unnecessary user prompts in backup and restore functions * refactor(script/v4.sh): remove unnecessary user prompts * fix: correct indentation in restore_config function * fix: correct indentation in restore_config function
1 parent 0af6bb8 commit fe1bf03

1 file changed

Lines changed: 1 addition & 19 deletions

File tree

script/v4.sh

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@ backup_config() {
243243

244244
if [ ! -d "$INSTALL_PATH/data" ]; then
245245
echo -e "${RED_COLOR}错误:未找到配置目录${RES}"
246-
read -p "按 Enter 继续..."
247246
return 1
248247
fi
249248

@@ -262,7 +261,6 @@ backup_config() {
262261
return 1
263262
fi
264263

265-
read -p "按Enter键继续..."
266264
return 0
267265
}
268266

@@ -274,7 +272,6 @@ restore_config() {
274272
local backup_base_dir="/opt/openlist_backups"
275273
if [ ! -d "$backup_base_dir" ]; then
276274
echo -e "${RED_COLOR}错误:未找到备份目录 $backup_base_dir${RES}"
277-
read -p "按Enter键继续..."
278275
return 1
279276
fi
280277

@@ -293,7 +290,6 @@ restore_config() {
293290

294291
if [ $backup_count -eq 0 ]; then
295292
echo -e "${RED_COLOR}未找到任何备份${RES}"
296-
read -p "按Enter继续..."
297293
return 1
298294
fi
299295

@@ -308,13 +304,11 @@ restore_config() {
308304
backup_path="${backup_list[$((choice-1))]}"
309305
else
310306
echo -e "${RED_COLOR}无效的选择${RES}"
311-
read -p "按Enter键继续..."
312307
return 1
313308
fi
314309

315310
if [ ! -d "$backup_path/data" ]; then
316311
echo -e "${RED_COLOR}错误:备份目录不存在或无效${RES}"
317-
read -p "按Enter键继续..."
318312
return 1
319313
fi
320314

@@ -340,8 +334,6 @@ restore_config() {
340334
echo -e "${YELLOW_COLOR}已取消恢复${RES}"
341335
;;
342336
esac
343-
344-
read -p "按 Enter 键继续..."
345337
}
346338

347339

@@ -633,8 +625,6 @@ check_system_status() {
633625
fi
634626

635627
echo
636-
read -p "按下 Enter 返回主菜单..." -n 1
637-
echo
638628
}
639629

640630
# Download
@@ -920,8 +910,6 @@ UPDATE() {
920910
echo -e "${GREEN_COLOR}当前版本:${RES}$version_info"
921911
echo -e "${GREEN_COLOR}更新时间:${RES}$(date '+%Y-%m-%d %H:%M:%S')"
922912
echo
923-
read -p "按下 Enter 返回主菜单..." -n 1
924-
echo
925913
}
926914

927915
UNINSTALL() {
@@ -1204,8 +1192,6 @@ SHOW_ABOUT() {
12041192
echo
12051193
echo -e "${YELLOW_COLOR}感谢使用 OpenList 管理脚本!${RES}"
12061194
echo
1207-
read -p "按下 Enter 返回主菜单..." -n 1
1208-
echo
12091195
}
12101196

12111197
INSTALL_CLI() {
@@ -1485,11 +1471,7 @@ if [ $# -eq 0 ]; then
14851471
while true; do
14861472
SHOW_MENU
14871473
echo
1488-
if [ $? -eq 0 ]; then
1489-
sleep 1 # 成功
1490-
else
1491-
sleep 2 # FAIL
1492-
fi
1474+
read -s -n1 -p "按任意键继续 ... "
14931475
clear
14941476
done
14951477
elif [ "$1" = "install" ]; then

0 commit comments

Comments
 (0)