1717# fn_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${hash}"
1818# fn_fetch_file "http://example.com/file.tar.bz2" "http://example.com/file2.tar.bz2" "file.tar.bz2" "file2.tar.bz2" "/some/dir" "file.tar.bz2" "chmodx" "run" "forcedl" "10cd7353aa9d758a075c600a6dd193fd"
1919
20- functionselfname =" $( basename " $( readlink -f " ${BASH_SOURCE[0]} " ) " ) "
20+ moduleselfname =" $( basename " $( readlink -f " ${BASH_SOURCE[0]} " ) " ) "
2121
2222fn_dl_steamcmd () {
2323 fn_print_start_nl " ${remotelocation} "
@@ -453,11 +453,13 @@ fn_fetch_file() {
453453 fi
454454}
455455
456- # GitHub file download functions .
456+ # GitHub file download modules .
457457# Used to simplify downloading specific files from GitHub.
458458
459- # github_fileurl_dir: the directory of the file in the GitHub: lgsm/functions
460- # github_fileurl_name: the filename of the file to download from GitHub: core_messages.sh
459+ # github_file_url_dir: the directory of the file in the GitHub: lgsm/modules
460+ # github_file_url_name: the filename of the file to download from GitHub: core_messages.sh
461+ # github_file_url_dir: the directory of the file in the GitHub: lgsm/modules
462+ # github_file_url_name: the filename of the file to download from GitHub: core_messages.sh
461463# githuburl: the full GitHub url
462464
463465# remote_fileurl: The URL of the file: http://example.com/dl/File.tar.bz2
@@ -470,58 +472,58 @@ fn_fetch_file() {
470472
471473# Fetches files from the Git repo.
472474fn_fetch_file_github () {
473- github_fileurl_dir =" ${1} "
474- github_fileurl_name =" ${2} "
475+ github_file_url_dir =" ${1} "
476+ github_file_url_name =" ${2} "
475477 # For legacy versions - code can be removed at a future date
476478 if [ " ${legacymode} " == " 1" ]; then
477- remote_fileurl=" https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /${github_fileurl_dir } /${github_fileurl_name } "
478- remote_fileurl_backup=" https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /${github_fileurl_dir } /${github_fileurl_name } "
479+ remote_fileurl=" https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /${github_file_url_dir } /${github_file_url_name } "
480+ remote_fileurl_backup=" https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /${github_file_url_dir } /${github_file_url_name } "
479481 # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork.
480482 elif [ " ${githubbranch} " == " master" ] && [ " ${githubuser} " == " GameServerManagers" ] && [ " ${commandname} " != " UPDATE-LGSM" ]; then
481- remote_fileurl=" https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${version} /${github_fileurl_dir } /${github_fileurl_name } "
482- remote_fileurl_backup=" https://bitbucket.org/${githubuser} /${githubrepo} /raw/${version} /${github_fileurl_dir } /${github_fileurl_name } "
483+ remote_fileurl=" https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${version} /${github_file_url_dir } /${github_file_url_name } "
484+ remote_fileurl_backup=" https://bitbucket.org/${githubuser} /${githubrepo} /raw/${version} /${github_file_url_dir } /${github_file_url_name } "
483485 else
484- remote_fileurl=" https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /${github_fileurl_dir } /${github_fileurl_name } "
485- remote_fileurl_backup=" https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /${github_fileurl_dir } /${github_fileurl_name } "
486+ remote_fileurl=" https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /${github_file_url_dir } /${github_file_url_name } "
487+ remote_fileurl_backup=" https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /${github_file_url_dir } /${github_file_url_name } "
486488 fi
487489 remote_fileurl_name=" GitHub"
488490 remote_fileurl_backup_name=" Bitbucket"
489491 local_filedir=" ${3} "
490- local_filename=" ${github_fileurl_name } "
492+ local_filename=" ${github_file_url_name } "
491493 chmodx=" ${4:- 0} "
492494 run=" ${5:- 0} "
493495 forcedl=" ${6:- 0} "
494496 hash=" ${7:- 0} "
495- # Passes vars to the file download function .
497+ # Passes vars to the file download module .
496498 fn_fetch_file " ${remote_fileurl} " " ${remote_fileurl_backup} " " ${remote_fileurl_name} " " ${remote_fileurl_backup_name} " " ${local_filedir} " " ${local_filename} " " ${chmodx} " " ${run} " " ${forcedl} " " ${hash} "
497499}
498500
499501fn_check_file_github () {
500- github_fileurl_dir =" ${1} "
501- github_fileurl_name =" ${2} "
502+ github_file_url_dir =" ${1} "
503+ github_file_url_name =" ${2} "
502504 if [ " ${githubbranch} " == " master" ] && [ " ${githubuser} " == " GameServerManagers" ] && [ " ${commandname} " != " UPDATE-LGSM" ]; then
503- remote_fileurl=" https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${version} /${github_fileurl_dir } /${github_fileurl_name } "
504- remote_fileurl_backup=" https://bitbucket.org/${githubuser} /${githubrepo} /raw/${version} /${github_fileurl_dir } /${github_fileurl_name } "
505+ remote_fileurl=" https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${version} /${github_file_url_dir } /${github_file_url_name } "
506+ remote_fileurl_backup=" https://bitbucket.org/${githubuser} /${githubrepo} /raw/${version} /${github_file_url_dir } /${github_file_url_name } "
505507 else
506- remote_fileurl=" https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /${github_fileurl_dir } /${github_fileurl_name } "
507- remote_fileurl_backup=" https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /${github_fileurl_dir } /${github_fileurl_name } "
508+ remote_fileurl=" https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /${github_file_url_dir } /${github_file_url_name } "
509+ remote_fileurl_backup=" https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /${github_file_url_dir } /${github_file_url_name } "
508510 fi
509511 remote_fileurl_name=" GitHub"
510512 remote_fileurl_backup_name=" Bitbucket"
511- fn_check_file " ${remote_fileurl} " " ${remote_fileurl_backup} " " ${remote_fileurl_name} " " ${remote_fileurl_backup_name} " " ${github_fileurl_name } "
513+ fn_check_file " ${remote_fileurl} " " ${remote_fileurl_backup} " " ${remote_fileurl_name} " " ${remote_fileurl_backup_name} " " ${github_file_url_name } "
512514}
513515
514516# Fetches config files from the Git repo.
515517fn_fetch_config () {
516- github_fileurl_dir =" ${1} "
517- github_fileurl_name =" ${2} "
518+ github_file_url_dir =" ${1} "
519+ github_file_url_name =" ${2} "
518520 # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork.
519521 if [ " ${githubbranch} " == " master" ] && [ " ${githubuser} " == " GameServerManagers" ] && [ " ${commandname} " != " UPDATE-LGSM" ]; then
520- remote_fileurl=" https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${version} /${github_fileurl_dir } /${github_fileurl_name } "
521- remote_fileurl_backup=" https://bitbucket.org/${githubuser} /${githubrepo} /raw/${version} /${github_fileurl_dir } /${github_fileurl_name } "
522+ remote_fileurl=" https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${version} /${github_file_url_dir } /${github_file_url_name } "
523+ remote_fileurl_backup=" https://bitbucket.org/${githubuser} /${githubrepo} /raw/${version} /${github_file_url_dir } /${github_file_url_name } "
522524 else
523- remote_fileurl=" https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /${github_fileurl_dir } /${github_fileurl_name } "
524- remote_fileurl_backup=" https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /${github_fileurl_dir } /${github_fileurl_name } "
525+ remote_fileurl=" https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /${github_file_url_dir } /${github_file_url_name } "
526+ remote_fileurl_backup=" https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /${github_file_url_dir } /${github_file_url_name } "
525527 fi
526528 remote_fileurl_name=" GitHub"
527529 remote_fileurl_backup_name=" Bitbucket"
@@ -531,55 +533,55 @@ fn_fetch_config() {
531533 run=" norun"
532534 forcedl=" noforce"
533535 hash=" nohash"
534- # Passes vars to the file download function .
536+ # Passes vars to the file download module .
535537 fn_fetch_file " ${remote_fileurl} " " ${remote_fileurl_backup} " " ${remote_fileurl_name} " " ${remote_fileurl_backup_name} " " ${local_filedir} " " ${local_filename} " " ${chmodx} " " ${run} " " ${forcedl} " " ${hash} "
536538}
537539
538540# Fetches modules from the Git repo during first download.
539- fn_fetch_function () {
540- github_fileurl_dir =" lgsm/functions "
541- github_fileurl_name =" ${functionfile } "
541+ fn_fetch_module () {
542+ github_file_url_dir =" lgsm/modules "
543+ github_file_url_name =" ${modulefile } "
542544 # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork.
543545 if [ " ${githubbranch} " == " master" ] && [ " ${githubuser} " == " GameServerManagers" ] && [ " ${commandname} " != " UPDATE-LGSM" ]; then
544- remote_fileurl=" https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${version} /${github_fileurl_dir } /${github_fileurl_name } "
545- remote_fileurl_backup=" https://bitbucket.org/${githubuser} /${githubrepo} /raw/${version} /${github_fileurl_dir } /${github_fileurl_name } "
546+ remote_fileurl=" https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${version} /${github_file_url_dir } /${github_file_url_name } "
547+ remote_fileurl_backup=" https://bitbucket.org/${githubuser} /${githubrepo} /raw/${version} /${github_file_url_dir } /${github_file_url_name } "
546548 else
547- remote_fileurl=" https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /${github_fileurl_dir } /${github_fileurl_name } "
548- remote_fileurl_backup=" https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /${github_fileurl_dir } /${github_fileurl_name } "
549+ remote_fileurl=" https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /${github_file_url_dir } /${github_file_url_name } "
550+ remote_fileurl_backup=" https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /${github_file_url_dir } /${github_file_url_name } "
549551 fi
550552 remote_fileurl_name=" GitHub"
551553 remote_fileurl_backup_name=" Bitbucket"
552- local_filedir=" ${functionsdir } "
553- local_filename=" ${github_fileurl_name } "
554+ local_filedir=" ${modulesdir } "
555+ local_filename=" ${github_file_url_name } "
554556 chmodx=" chmodx"
555557 run=" run"
556558 forcedl=" noforce"
557559 hash=" nohash"
558- # Passes vars to the file download function .
560+ # Passes vars to the file download module .
559561 fn_fetch_file " ${remote_fileurl} " " ${remote_fileurl_backup} " " ${remote_fileurl_name} " " ${remote_fileurl_backup_name} " " ${local_filedir} " " ${local_filename} " " ${chmodx} " " ${run} " " ${forcedl} " " ${hash} "
560562}
561563
562564# Fetches modules from the Git repo during update-lgsm.
563- fn_update_function () {
564- github_fileurl_dir =" lgsm/functions "
565- github_fileurl_name =" ${functionfile } "
565+ fn_update_module () {
566+ github_file_url_dir =" lgsm/modules "
567+ github_file_url_name =" ${modulefile } "
566568 # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork.
567569 if [ " ${githubbranch} " == " master" ] && [ " ${githubuser} " == " GameServerManagers" ] && [ " ${commandname} " != " UPDATE-LGSM" ]; then
568- remote_fileurl=" https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${version} /${github_fileurl_dir } /${github_fileurl_name } "
569- remote_fileurl_backup=" https://bitbucket.org/${githubuser} /${githubrepo} /raw/${version} /${github_fileurl_dir } /${github_fileurl_name } "
570+ remote_fileurl=" https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${version} /${github_file_url_dir } /${github_file_url_name } "
571+ remote_fileurl_backup=" https://bitbucket.org/${githubuser} /${githubrepo} /raw/${version} /${github_file_url_dir } /${github_file_url_name } "
570572 else
571- remote_fileurl=" https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /${github_fileurl_dir } /${github_fileurl_name } "
572- remote_fileurl_backup=" https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /${github_fileurl_dir } /${github_fileurl_name } "
573+ remote_fileurl=" https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /${github_file_url_dir } /${github_file_url_name } "
574+ remote_fileurl_backup=" https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /${github_file_url_dir } /${github_file_url_name } "
573575 fi
574576 remote_fileurl_name=" GitHub"
575577 remote_fileurl_backup_name=" Bitbucket"
576- local_filedir=" ${functionsdir } "
577- local_filename=" ${github_fileurl_name } "
578+ local_filedir=" ${modulesdir } "
579+ local_filename=" ${github_file_url_name } "
578580 chmodx=" chmodx"
579581 run=" norun"
580582 forcedl=" noforce"
581583 hash=" nohash"
582- # Passes vars to the file download function .
584+ # Passes vars to the file download module .
583585 fn_fetch_file " ${remote_fileurl} " " ${remote_fileurl_backup} " " ${remote_fileurl_name} " " ${remote_fileurl_backup_name} " " ${local_filedir} " " ${local_filename} " " ${chmodx} " " ${run} " " ${forcedl} " " ${hash} "
584586
585587}
@@ -618,7 +620,7 @@ fn_dl_latest_release_github() {
618620 fn_print_fail_nl " Cannot get version from GitHub API for ${githubreleaseuser} /${githubreleaserepo} "
619621 fn_script_log_fatal " Cannot get version from GitHub API for ${githubreleaseuser} /${githubreleaserepo} "
620622 else
621- # Fetch file from the remote location from the existing function to the ${tmpdir} for now.
623+ # Fetch file from the remote location from the existing module to the ${tmpdir} for now.
622624 fn_fetch_file " ${githubreleasedownloadlink} " " " " ${githubreleasefilename} " " " " ${githubreleasedownloadpath} " " ${githubreleasefilename} "
623625 fi
624626 fi
0 commit comments