|
32 | 32 | fn_print_ok_nl "Selecting repo: ${remotereponame}" |
33 | 33 | fi |
34 | 34 |
|
35 | | -# Check _default.cfg. |
36 | | -echo -en "checking ${remotereponame} config _default.cfg...\c" |
37 | | -fn_script_log_info "Checking ${remotereponame} config _default.cfg" |
38 | | -if [ "${remotereponame}" == "GitHub" ]; then |
39 | | - curl -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null |
40 | | -else |
41 | | - curl -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null |
42 | | -fi |
43 | | -if [ $? != "0" ]; then |
44 | | - fn_print_fail_eol_nl |
45 | | - fn_script_log_fatal "Checking ${remotereponame} config _default.cfg" |
46 | | - fn_script_log_fatal "Curl returned error: $?" |
47 | | - core_exit.sh |
48 | | -fi |
49 | | - |
50 | | -if [ "${remotereponame}" == "GitHub" ]; then |
51 | | - config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg")) |
52 | | -else |
53 | | - config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg")) |
54 | | -fi |
55 | | - |
56 | | -if [ "${config_file_diff}" != "" ]; then |
57 | | - fn_print_update_eol_nl |
58 | | - fn_script_log_update "Checking ${remotereponame} config _default.cfg" |
59 | | - rm -f "${configdirdefault:?}/config-lgsm/${gameservername:?}/_default.cfg" |
60 | | - fn_fetch_file_github "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "nochmodx" "norun" "noforce" "nomd5" |
61 | | - alert="config" |
62 | | - alert.sh |
63 | | -else |
64 | | - fn_print_ok_eol_nl |
65 | | - fn_script_log_pass "Checking ${remotereponame} config _default.cfg" |
66 | | -fi |
67 | | - |
68 | 35 | # Check linuxsm.sh |
69 | 36 | echo -en "checking ${remotereponame} linuxgsm.sh...\c" |
70 | 37 | if [ "${remotereponame}" == "GitHub" ]; then |
@@ -144,6 +111,39 @@ else |
144 | 111 | fn_script_log_info "Checking ${selfname}" |
145 | 112 | fi |
146 | 113 |
|
| 114 | +# Check _default.cfg. |
| 115 | +echo -en "checking ${remotereponame} config _default.cfg...\c" |
| 116 | +fn_script_log_info "Checking ${remotereponame} config _default.cfg" |
| 117 | +if [ "${remotereponame}" == "GitHub" ]; then |
| 118 | + curl -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null |
| 119 | +else |
| 120 | + curl -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null |
| 121 | +fi |
| 122 | +if [ $? != "0" ]; then |
| 123 | + fn_print_fail_eol_nl |
| 124 | + fn_script_log_fatal "Checking ${remotereponame} config _default.cfg" |
| 125 | + fn_script_log_fatal "Curl returned error: $?" |
| 126 | + core_exit.sh |
| 127 | +fi |
| 128 | + |
| 129 | +if [ "${remotereponame}" == "GitHub" ]; then |
| 130 | + config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg")) |
| 131 | +else |
| 132 | + config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg")) |
| 133 | +fi |
| 134 | + |
| 135 | +if [ "${config_file_diff}" != "" ]; then |
| 136 | + fn_print_update_eol_nl |
| 137 | + fn_script_log_update "Checking ${remotereponame} config _default.cfg" |
| 138 | + rm -f "${configdirdefault:?}/config-lgsm/${gameservername:?}/_default.cfg" |
| 139 | + fn_fetch_file_github "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "nochmodx" "norun" "noforce" "nomd5" |
| 140 | + alert="config" |
| 141 | + alert.sh |
| 142 | +else |
| 143 | + fn_print_ok_eol_nl |
| 144 | + fn_script_log_pass "Checking ${remotereponame} config _default.cfg" |
| 145 | +fi |
| 146 | + |
147 | 147 | # Check and update modules. |
148 | 148 | if [ -n "${functionsdir}" ]; then |
149 | 149 | if [ -d "${functionsdir}" ]; then |
|
0 commit comments