mirror of
https://github.com/aclist/dztui.git
synced 2025-04-08 21:43:03 +02:00
Fallback to manual mode if mods exceed /tmp space
This commit is contained in:
parent
6a9e4f547d
commit
e289a3fc43
1 changed files with 9 additions and 5 deletions
14
dztui.sh
14
dztui.sh
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
version=0.4.0
|
version=0.4.1
|
||||||
release_url="https://raw.githubusercontent.com/aclist/dztui/main/dztui.sh"
|
release_url="https://raw.githubusercontent.com/aclist/dztui/main/dztui.sh"
|
||||||
aid=221100
|
aid=221100
|
||||||
game="dayz"
|
game="dayz"
|
||||||
|
@ -236,11 +236,15 @@ failed_mod_check(){
|
||||||
disksize=$(df $staging_dir --output=avail | tail -n1)
|
disksize=$(df $staging_dir --output=avail | tail -n1)
|
||||||
bytewise=$((disksize * 1024))
|
bytewise=$((disksize * 1024))
|
||||||
hr=$(echo $(numfmt --to=iec --format "%8.1f" $bytewise $totalmodsize) | sed 's/ /\//')
|
hr=$(echo $(numfmt --to=iec --format "%8.1f" $bytewise $totalmodsize) | sed 's/ /\//')
|
||||||
if [[ $totalmodsize -gt $bytewise ]]; then
|
if [[ $auto_install_mods -eq 1 ]]; then
|
||||||
printf "[ERROR] Not enough space to install mods: %s\n" $hr
|
if [[ $totalmodsize -gt $bytewise ]]; then
|
||||||
return
|
printf "[ERROR] Not enough space in /tmp to automatically stage mods: %s\n" $hr
|
||||||
|
manual_mod_install
|
||||||
|
else
|
||||||
|
auto_mod_install
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
[[ $auto_install_mods -eq 1 ]] && auto_mod_install || manual_mod_install
|
|
||||||
}
|
}
|
||||||
passed_mod_check(){
|
passed_mod_check(){
|
||||||
printf "[INFO] Mod check passed\n"
|
printf "[INFO] Mod check passed\n"
|
||||||
|
|
Loading…
Reference in a new issue