Skip to content
Permalink
Browse files

feat(core-dl): improve resilience of large downloads

  • Loading branch information
dgibbs64 committed Dec 1, 2019
1 parent e9c5d55 commit d888ca37f3a96376ed2a8fec39b6e9e59d240d34
Showing with 4 additions and 5 deletions.
  1. +1 −1 lgsm/functions/command_monitor.sh
  2. +1 −2 lgsm/functions/command_update_linuxgsm.sh
  3. +2 −2 lgsm/functions/core_dl.sh
@@ -19,7 +19,7 @@ fn_monitor_check_lockfile(){
fn_sleep_time
fn_print_error "Checking lockfile: No lockfile found: "
fn_print_error_eol
fn_script_log_error "Checking lockfile: No lockfile found: ERROR"
fn_script_log_error_nl "Checking lockfile: No lockfile found: ERROR"
fn_sleep_time
echo -e " * Start ${selfname} to run monitor."
core_exit.sh
@@ -56,12 +56,11 @@ if [ -z "${legacymode}" ]; then
echo -e " Backup: ${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak"
fi
echo -en " fetching ${selfname}...\c"
exitcode=$?
cp "${tmpdir}/linuxgsm.sh" "${rootdir}/${selfname}"
sed -i "s/shortname=\"core\"/shortname=\"${shortname}\"/g" "${rootdir}/${selfname}"
sed -i "s/gameservername=\"core\"/gameservername=\"${gameservername}\"/g" "${rootdir}/${selfname}"
sed -i "s/gamename=\"core\"/gamename=\"${gamename}\"/g" "${rootdir}/${selfname}"

exitcode=$?
if [ "${exitcode}" == "0" ]; then
fn_print_fail_eol_nl
core_exit.sh
@@ -133,11 +133,11 @@ fn_fetch_file(){
echo -en "downloading ${local_filename}..."
fn_sleep_time
echo -en "\033[1K"
curlcmd=$(curl --progress-bar --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}")
curlcmd=$(curl --progress-bar --retry 10 --retry-delay 3 --fail -L -C - -o "${local_filedir}/${local_filename}" "${remote_fileurl}")
echo -en "downloading ${local_filename}..."
else
echo -en " fetching ${local_filename}...\c"
curlcmd=$(curl -s --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}" 2>&1)
curlcmd=$(curl -s --retry 3 --retry-delay 3 --fail -L -C - -o "${local_filedir}/${local_filename}" "${remote_fileurl}" 2>&1)
fi
local exitcode=$?
if [ ${exitcode} -ne 0 ]; then

0 comments on commit d888ca3

Please sign in to comment.
You can’t perform that action at this time.