Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions lgsm/modules/command_fastdl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ luasvautorundir="${systemdir}/lua/autorun/server"
luafastdlfile="lgsm_cl_force_fastdl.lua"
luafastdlfullpath="${luasvautorundir}/${luafastdlfile}"

# Check if bzip2 is installed.
if [ ! "$(command -v bzip2 2> /dev/null)" ]; then
fn_print_fail "bzip2 is not installed"
fn_script_log_fail "bzip2 is not installed"
core_exit.sh
fi

# Header
fn_print_header
fn_print_nl "More info: ${italic}https://docs.linuxgsm.com/commands/fastdl"
Expand Down Expand Up @@ -112,13 +105,13 @@ fn_fastdl_dirs() {
# Using this gist https://gist.github.com/agunnerson-ibm/efca449565a3e7356906
fn_human_readable_file_size() {
local abbrevs=(
$((1 << 60)):ZB
$((1 << 50)):EB
$((1 << 40)):TB
$((1 << 30)):GB
$((1 << 20)):MB
$((1 << 10)):KB
$((1)):bytes
"1152921504606846976:ZB"
"1125899906842624:EB"
"1099511627776:TB"
"1073741824:GB"
"1048576:MB"
"1024:KB"
"1:bytes"
)

local bytes="${1}"
Expand Down Expand Up @@ -225,11 +218,17 @@ fn_fastdl_preview() {
fn_script_log_fail "Generating file list."
core_exit.sh
fi
fn_print_nl "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size "${filesizetotal}" 0)"

if [ "${engine}" == "source" ]; then
echo -e "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size "${filesizetotal}" 0)"
elif [ "${engine}" == "goldsrc" ]; then
echo -e "about to copy ${totalfiles} files, total size $(fn_human_readable_file_size "${filesizetotal}" 0)"
fi

fn_script_log_info "${totalfiles} files, total size $(fn_human_readable_file_size "${filesizetotal}" 0)"
rm -f "${tmpdir:?}/fastdl_files_to_compress.txt"
if ! fn_prompt_yn "Continue?" Y; then
fn_script_log "User exited"
exitcode=0
core_exit.sh
fi
}
Expand Down Expand Up @@ -431,7 +430,9 @@ fn_fastdl_preview
fn_clear_old_fastdl
fn_fastdl_dirs
fn_fastdl_build
fn_fastdl_bzip2
if [ "${engine}" == "source" ]; then
fn_fastdl_bzip2
fi
# Finished message.
fn_print_nl "Fastdl files are located in:"
fn_print_nl "${fastdldir}"
Expand Down
1 change: 1 addition & 0 deletions lgsm/modules/command_mods_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ if [ -f "${modsinstalledlistfullpath}" ]; then
fn_script_log_warn "${modprettyname} is already installed"
echo -e " * Any configs may be overwritten."
if ! fn_prompt_yn "Continue?" Y; then
exitcode=0
core_exit.sh
fi
fn_script_log_info "User selected to continue"
Expand Down
1 change: 1 addition & 0 deletions lgsm/modules/command_mods_remove.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ done
fn_print_warning_nl "You are about to remove ${cyan}${usermodselect}${default}."
echo -e " * Any custom files/configuration will be removed."
if ! fn_prompt_yn "Continue?" Y; then
exitcode=0
core_exit.sh
fi

Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/core_getopt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ fi
## Game server exclusive commands.

# FastDL command.
if [ "${engine}" == "source" ]; then
if [ "${engine}" == "source" ] || [ "${engine}" == "goldsrc" ]; then
currentopt+=("${cmd_fastdl[@]}")
fi

Expand Down