Skip to content

Commit 64952f7

Browse files
committed
feat: host machine 7z command to decompress
1 parent d739e42 commit 64952f7

File tree

2 files changed

+29
-5
lines changed

2 files changed

+29
-5
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ Docker启动容器名称设置 -> 6 1
147147
Docker镜像源选择 -> 6 6
148148
非可选网络模式容器默认网络模式 -> 6 7
149149
进入弃用菜单 -> 6 8
150+
开启/关闭 使用宿主机7z命令解压 -> 6 9
150151
```
151152

152153
**弃用菜单(此菜单下的功能不再维护,不建议使用)**

all_in_one.sh

+28-5
Original file line numberDiff line numberDiff line change
@@ -1985,7 +1985,7 @@ function __unzip_metadata() {
19851985
if ! check_metadata_size "${1}"; then
19861986
exit 1
19871987
fi
1988-
if [[ "${OSNAME}" = "macos" ]]; then
1988+
if [[ "${OSNAME}" = "macos" ]] || [[ "$(cat "${DDSREM_CONFIG_DIR}/container_run_extra_parameters.txt")" == "true" ]]; then
19891989
INFO "使用宿主机 7z 命令解压"
19901990
if [ "${1}" == "config.mp4" ] || [ "${1}" == "config.new.mp4" ]; then
19911991
if [ ! -d "${MEDIA_DIR}" ]; then
@@ -2213,7 +2213,7 @@ function unzip_appoint_xiaoya_emby_jellyfin() {
22132213
exit 1
22142214
fi
22152215

2216-
if [[ "${OSNAME}" = "macos" ]]; then
2216+
if [[ "${OSNAME}" = "macos" ]] || [[ "$(cat "${DDSREM_CONFIG_DIR}/container_run_extra_parameters.txt")" == "true" ]]; then
22172217
INFO "使用宿主机 7z 命令解压"
22182218
if [ ! -d "${MEDIA_DIR}/xiaoya" ]; then
22192219
mkdir -p "${MEDIA_DIR}/xiaoya"
@@ -5187,7 +5187,7 @@ function reset_script_configuration() {
51875187

51885188
function main_advanced_configuration() {
51895189

5190-
__container_run_extra_parameters=$(cat ${DDSREM_CONFIG_DIR}/container_run_extra_parameters.txt)
5190+
__container_run_extra_parameters=$(cat "${DDSREM_CONFIG_DIR}/container_run_extra_parameters.txt")
51915191
if [ "${__container_run_extra_parameters}" == "true" ]; then
51925192
_container_run_extra_parameters="${Green}开启${Font}"
51935193
elif [ "${__container_run_extra_parameters}" == "false" ]; then
@@ -5196,6 +5196,15 @@ function main_advanced_configuration() {
51965196
_container_run_extra_parameters="${Red}错误${Font}"
51975197
fi
51985198

5199+
__use_host_7z_command=$(cat "${DDSREM_CONFIG_DIR}/use_host_7z_command.txt")
5200+
if [ "${__use_host_7z_command}" == "true" ]; then
5201+
_use_host_7z_command="${Green}开启${Font}"
5202+
elif [ "${__use_host_7z_command}" == "false" ]; then
5203+
_use_host_7z_command="${Red}关闭${Font}"
5204+
else
5205+
_use_host_7z_command="${Red}错误${Font}"
5206+
fi
5207+
51995208
__disk_capacity_detection=$(cat ${DDSREM_CONFIG_DIR}/disk_capacity_detection.txt)
52005209
if [ "${__disk_capacity_detection}" == "true" ]; then
52015210
_disk_capacity_detection="${Green}开启${Font}"
@@ -5226,9 +5235,10 @@ function main_advanced_configuration() {
52265235
echo -e "6、Docker镜像源选择"
52275236
echo -e "7、非可选网络模式容器默认网络模式 当前状态:${Blue}${_default_network}${Font}"
52285237
echo -e "8、弃用菜单"
5238+
echo -e "9、开启/关闭 使用宿主机7z命令解压 当前状态:${_use_host_7z_command}"
52295239
echo -e "0、返回上级"
52305240
echo -e "——————————————————————————————————————————————————————————————————————————————————"
5231-
read -erp "请输入数字 [0-8]:" num
5241+
read -erp "请输入数字 [0-9]:" num
52325242
case "$num" in
52335243
1)
52345244
clear
@@ -5289,13 +5299,22 @@ function main_advanced_configuration() {
52895299
clear
52905300
main_deprecation
52915301
;;
5302+
9)
5303+
if [ "${__use_host_7z_command}" == "false" ]; then
5304+
echo 'true' > ${DDSREM_CONFIG_DIR}/use_host_7z_command.txt
5305+
else
5306+
echo 'false' > ${DDSREM_CONFIG_DIR}/use_host_7z_command.txt
5307+
fi
5308+
clear
5309+
main_advanced_configuration
5310+
;;
52925311
0)
52935312
clear
52945313
main_return
52955314
;;
52965315
*)
52975316
clear
5298-
ERROR '请输入正确数字 [0-8]'
5317+
ERROR '请输入正确数字 [0-9]'
52995318
main_advanced_configuration
53005319
;;
53015320
esac
@@ -5533,6 +5552,10 @@ function first_init() {
55335552
echo 'false' > ${DDSREM_CONFIG_DIR}/container_run_extra_parameters.txt
55345553
fi
55355554

5555+
if [ ! -f "${DDSREM_CONFIG_DIR}/use_host_7z_command.txt" ]; then
5556+
echo 'false' > "${DDSREM_CONFIG_DIR}/use_host_7z_command.txt"
5557+
fi
5558+
55365559
if [ ! -d "${DDSREM_CONFIG_DIR}/data_crep" ]; then
55375560
mkdir -p "${DDSREM_CONFIG_DIR}/data_crep"
55385561
fi

0 commit comments

Comments
 (0)