Skip to content

Commit

Permalink
feat: reset script configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
DDSRem committed Feb 11, 2024
1 parent 1f2a35b commit a9ded3c
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ bash -c "$(curl -sL https://raw.githubusercontent.com/DDS-Derek/xiaoya-alist/mas
```shell
Docker启动容器名称设置 -> 71
是否开启容器运行额外参数添加 -> 72
重置脚本配置 -> 73
```

## 地址
Expand Down
48 changes: 45 additions & 3 deletions main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2090,6 +2090,43 @@ function container_name_settings() {

}

function reset_script_configuration() {

INFO "是否${Red}删除所有脚本配置文件${Font} [Y/n](默认 Y 删除)"
read -erp "Clean config:" CLEAN_CONFIG
[[ -z "${CLEAN_CONFIG}" ]] && CLEAN_CONFIG="y"

if [[ ${CLEAN_CONFIG} == [Yy] ]]; then
for i in $(seq -w 3 -1 0); do
echo -en "即将开始清理配置文件${Blue} $i ${Font}\r"
sleep 1
done
rm -rf ${DDSREM_CONFIG_DIR}/container_name
rm -f \
xiaoya_alist_tvbox_config_dir.txt \
xiaoya_alist_media_dir.txt \
xiaoya_alist_config_dir.txt \
resilio_config_dir.txt \
portainer_config_dir.txt \
onelist_config_dir.txt \
container_run_extra_parameters.txt \
auto_symlink_config_dir.txt
INFO "清理完成!"

for i in $(seq -w 3 -1 0); do
echo -en "即将返回主界面并重新生成默认配置${Blue} $i ${Font}\r"
sleep 1
done

first_init
clear
main
else
exit 0
fi

}

function main_advanced_configuration() {

container_run_extra_parameters=$(cat ${DDSREM_CONFIG_DIR}/container_run_extra_parameters.txt)
Expand All @@ -2098,9 +2135,10 @@ function main_advanced_configuration() {
echo -e "${Blue}高级配置${Font}\n"
echo -e "1、容器名称设置"
echo -e "2、是否开启容器运行额外参数添加(当前:${Green}${container_run_extra_parameters}${Font}"
echo -e "3、返回上级"
echo -e "3、重置脚本配置"
echo -e "4、返回上级"
echo -e "——————————————————————————————————————————————————————————————————————————————————"
read -erp "请输入数字 [1-3]:" num
read -erp "请输入数字 [1-4]:" num
case "$num" in
1)
clear
Expand All @@ -2116,12 +2154,16 @@ function main_advanced_configuration() {
main_advanced_configuration
;;
3)
clear
reset_script_configuration
;;
4)
clear
main_return
;;
*)
clear
ERROR '请输入正确数字 [1-3]'
ERROR '请输入正确数字 [1-4]'
main_advanced_configuration
;;
esac
Expand Down

0 comments on commit a9ded3c

Please sign in to comment.