17
17
# fn_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${hash}"
18
18
# 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"
19
19
20
- functionselfname =" $( basename " $( readlink -f " ${BASH_SOURCE[0]} " ) " ) "
20
+ moduleselfname =" $( basename " $( readlink -f " ${BASH_SOURCE[0]} " ) " ) "
21
21
22
22
fn_dl_steamcmd () {
23
23
fn_print_start_nl " ${remotelocation} "
@@ -453,11 +453,13 @@ fn_fetch_file() {
453
453
fi
454
454
}
455
455
456
- # GitHub file download functions .
456
+ # GitHub file download modules .
457
457
# Used to simplify downloading specific files from GitHub.
458
458
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
461
463
# githuburl: the full GitHub url
462
464
463
465
# remote_fileurl: The URL of the file: http://example.com/dl/File.tar.bz2
@@ -470,58 +472,58 @@ fn_fetch_file() {
470
472
471
473
# Fetches files from the Git repo.
472
474
fn_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} "
475
477
# For legacy versions - code can be removed at a future date
476
478
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 } "
479
481
# If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork.
480
482
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 } "
483
485
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 } "
486
488
fi
487
489
remote_fileurl_name=" GitHub"
488
490
remote_fileurl_backup_name=" Bitbucket"
489
491
local_filedir=" ${3} "
490
- local_filename=" ${github_fileurl_name } "
492
+ local_filename=" ${github_file_url_name } "
491
493
chmodx=" ${4:- 0} "
492
494
run=" ${5:- 0} "
493
495
forcedl=" ${6:- 0} "
494
496
hash=" ${7:- 0} "
495
- # Passes vars to the file download function .
497
+ # Passes vars to the file download module .
496
498
fn_fetch_file " ${remote_fileurl} " " ${remote_fileurl_backup} " " ${remote_fileurl_name} " " ${remote_fileurl_backup_name} " " ${local_filedir} " " ${local_filename} " " ${chmodx} " " ${run} " " ${forcedl} " " ${hash} "
497
499
}
498
500
499
501
fn_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} "
502
504
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 } "
505
507
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 } "
508
510
fi
509
511
remote_fileurl_name=" GitHub"
510
512
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 } "
512
514
}
513
515
514
516
# Fetches config files from the Git repo.
515
517
fn_fetch_config () {
516
- github_fileurl_dir =" ${1} "
517
- github_fileurl_name =" ${2} "
518
+ github_file_url_dir =" ${1} "
519
+ github_file_url_name =" ${2} "
518
520
# If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork.
519
521
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 } "
522
524
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 } "
525
527
fi
526
528
remote_fileurl_name=" GitHub"
527
529
remote_fileurl_backup_name=" Bitbucket"
@@ -531,55 +533,55 @@ fn_fetch_config() {
531
533
run=" norun"
532
534
forcedl=" noforce"
533
535
hash=" nohash"
534
- # Passes vars to the file download function .
536
+ # Passes vars to the file download module .
535
537
fn_fetch_file " ${remote_fileurl} " " ${remote_fileurl_backup} " " ${remote_fileurl_name} " " ${remote_fileurl_backup_name} " " ${local_filedir} " " ${local_filename} " " ${chmodx} " " ${run} " " ${forcedl} " " ${hash} "
536
538
}
537
539
538
540
# 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 } "
542
544
# If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork.
543
545
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 } "
546
548
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 } "
549
551
fi
550
552
remote_fileurl_name=" GitHub"
551
553
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 } "
554
556
chmodx=" chmodx"
555
557
run=" run"
556
558
forcedl=" noforce"
557
559
hash=" nohash"
558
- # Passes vars to the file download function .
560
+ # Passes vars to the file download module .
559
561
fn_fetch_file " ${remote_fileurl} " " ${remote_fileurl_backup} " " ${remote_fileurl_name} " " ${remote_fileurl_backup_name} " " ${local_filedir} " " ${local_filename} " " ${chmodx} " " ${run} " " ${forcedl} " " ${hash} "
560
562
}
561
563
562
564
# 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 } "
566
568
# If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork.
567
569
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 } "
570
572
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 } "
573
575
fi
574
576
remote_fileurl_name=" GitHub"
575
577
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 } "
578
580
chmodx=" chmodx"
579
581
run=" norun"
580
582
forcedl=" noforce"
581
583
hash=" nohash"
582
- # Passes vars to the file download function .
584
+ # Passes vars to the file download module .
583
585
fn_fetch_file " ${remote_fileurl} " " ${remote_fileurl_backup} " " ${remote_fileurl_name} " " ${remote_fileurl_backup_name} " " ${local_filedir} " " ${local_filename} " " ${chmodx} " " ${run} " " ${forcedl} " " ${hash} "
584
586
585
587
}
@@ -618,7 +620,7 @@ fn_dl_latest_release_github() {
618
620
fn_print_fail_nl " Cannot get version from GitHub API for ${githubreleaseuser} /${githubreleaserepo} "
619
621
fn_script_log_fatal " Cannot get version from GitHub API for ${githubreleaseuser} /${githubreleaserepo} "
620
622
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.
622
624
fn_fetch_file " ${githubreleasedownloadlink} " " " " ${githubreleasefilename} " " " " ${githubreleasedownloadpath} " " ${githubreleasefilename} "
623
625
fi
624
626
fi
0 commit comments