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