@@ -16,8 +16,9 @@ info_distro.sh
1616info_game.sh
1717
1818# Prevent github from using a cached version of the file if dev-debug is enabled.
19+ nocache=()
1920if [ -f " ${rootdir} /.dev-debug" ]; then
20- nocache=" -H \ " Cache-Control: no-cache\ " -H \ " Pragma: no-cache\" "
21+ nocache=( -H " Cache-Control: no-cache" -H " Pragma: no-cache" )
2122fi
2223
2324fn_script_log_info " Updating LinuxGSM"
@@ -26,10 +27,10 @@ fn_print_dots "Selecting repo"
2627fn_script_log_info " Selecting repo"
2728# Select remotereponame
2829
29- curl ${nocache} --connect-timeout 3 -IsfL " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /linuxgsm.sh" 1> /dev/null
30+ curl " ${nocache[@]} " --connect-timeout 3 -IsfL " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /linuxgsm.sh" 1> /dev/null
3031exitcode=$?
3132if [ " ${exitcode} " -ne " 0" ]; then
32- curl ${nocache} --connect-timeout 3 -IsfL " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /linuxgsm.sh" 1> /dev/null
33+ curl " ${nocache[@]} " --connect-timeout 3 -IsfL " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /linuxgsm.sh" 1> /dev/null
3334 exitcode=$?
3435 if [ " ${exitcode} " -ne " 0" ]; then
3536 fn_print_fail_nl " Selecting repo: Unable to to access GitHub or Bitbucket repositories"
4748# Check linuxsm.sh
4849echo -en " checking ${remotereponame} script [ ${italic} linuxgsm.sh${default} ]\c"
4950if [ " ${remotereponame} " == " GitHub" ]; then
50- curl ${nocache} --connect-timeout 3 -IsfL " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /linuxgsm.sh" 1> /dev/null
51+ curl " ${nocache[@]} " --connect-timeout 3 -IsfL " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /linuxgsm.sh" 1> /dev/null
5152else
52- curl ${nocache} --connect-timeout 3 -IsfL " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /linuxgsm.sh" 1> /dev/null
53+ curl " ${nocache[@]} " --connect-timeout 3 -IsfL " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /linuxgsm.sh" 1> /dev/null
5354fi
5455exitcode=$?
5556if [ " ${exitcode} " -ne 0 ]; then
@@ -60,9 +61,9 @@ if [ "${exitcode}" -ne 0 ]; then
6061fi
6162
6263if [ " ${remotereponame} " == " GitHub" ]; then
63- tmp_script_diff=$( diff " ${tmpdir} /linuxgsm.sh" <( curl ${nocache} --connect-timeout 3 -s " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /linuxgsm.sh" ) )
64+ tmp_script_diff=$( diff " ${tmpdir} /linuxgsm.sh" <( curl " ${nocache[@]} " --connect-timeout 3 -s " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /linuxgsm.sh" ) )
6465else
65- tmp_script_diff=$( diff " ${tmpdir} /linuxgsm.sh" <( curl ${nocache} --connect-timeout 3 -s " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /linuxgsm.sh" ) )
66+ tmp_script_diff=$( diff " ${tmpdir} /linuxgsm.sh" <( curl " ${nocache[@]} " --connect-timeout 3 -s " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /linuxgsm.sh" ) )
6667fi
6768
6869if [ " ${tmp_script_diff} " != " " ]; then
130131echo -en " checking ${remotereponame} config [ ${italic} _default.cfg${default} ]\c"
131132fn_script_log_info " Checking ${remotereponame} config _default.cfg"
132133if [ " ${remotereponame} " == " GitHub" ]; then
133- curl ${nocache} --connect-timeout 3 -IsfL " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /lgsm/config-default/config-lgsm/${gameservername} /_default.cfg" 1> /dev/null
134+ curl " ${nocache[@]} " --connect-timeout 3 -IsfL " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /lgsm/config-default/config-lgsm/${gameservername} /_default.cfg" 1> /dev/null
134135else
135- curl ${nocache} --connect-timeout 3 -IsfL " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /lgsm/config-default/config-lgsm/${gameservername} /_default.cfg" 1> /dev/null
136+ curl " ${nocache[@]} " --connect-timeout 3 -IsfL " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /lgsm/config-default/config-lgsm/${gameservername} /_default.cfg" 1> /dev/null
136137fi
137138exitcode=$?
138139if [ " ${exitcode} " -ne 0 ]; then
@@ -143,9 +144,9 @@ if [ "${exitcode}" -ne 0 ]; then
143144fi
144145
145146if [ " ${remotereponame} " == " GitHub" ]; then
146- config_file_diff=$( diff " ${configdirdefault} /config-lgsm/${gameservername} /_default.cfg" <( curl ${nocache} --connect-timeout 3 -s " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /lgsm/config-default/config-lgsm/${gameservername} /_default.cfg" ) )
147+ config_file_diff=$( diff " ${configdirdefault} /config-lgsm/${gameservername} /_default.cfg" <( curl " ${nocache[@]} " --connect-timeout 3 -s " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /lgsm/config-default/config-lgsm/${gameservername} /_default.cfg" ) )
147148else
148- config_file_diff=$( diff " ${configdirdefault} /config-lgsm/${gameservername} /_default.cfg" <( curl ${nocache} --connect-timeout 3 -s " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /lgsm/config-default/config-lgsm/${gameservername} /_default.cfg" ) )
149+ config_file_diff=$( diff " ${configdirdefault} /config-lgsm/${gameservername} /_default.cfg" <( curl " ${nocache[@]} " --connect-timeout 3 -s " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /lgsm/config-default/config-lgsm/${gameservername} /_default.cfg" ) )
149150fi
150151
151152if [ " ${config_file_diff} " != " " ]; then
@@ -165,9 +166,9 @@ if [ -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then
165166 echo -en " checking ${remotereponame} config [ ${italic}${distroid} -${distroversioncsv} .csv${default} ]\c"
166167 fn_script_log_info " Checking ${remotereponame} ${distroid} -${distroversioncsv} .csv"
167168 if [ " ${remotereponame} " == " GitHub" ]; then
168- curl ${nocache} --connect-timeout 3 -IsfL " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /lgsm/data/${distroid} -${distroversioncsv} .csv" 1> /dev/null
169+ curl " ${nocache[@]} " --connect-timeout 3 -IsfL " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /lgsm/data/${distroid} -${distroversioncsv} .csv" 1> /dev/null
169170 else
170- curl ${nocache} --connect-timeout 3 -IsfL " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /lgsm/data/${distroid} -${distroversioncsv} .csv" 1> /dev/null
171+ curl " ${nocache[@]} " --connect-timeout 3 -IsfL " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /lgsm/data/${distroid} -${distroversioncsv} .csv" 1> /dev/null
171172 fi
172173 exitcode=$?
173174 if [ " ${exitcode} " -ne 0 ]; then
@@ -178,9 +179,9 @@ if [ -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then
178179 fi
179180
180181 if [ " ${remotereponame} " == " GitHub" ]; then
181- config_file_diff=$( diff " ${datadir} /${distroid} -${distroversioncsv} .csv" <( curl ${nocache} --connect-timeout 3 -s " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /lgsm/data/${distroid} -${distroversioncsv} .csv" ) )
182+ config_file_diff=$( diff " ${datadir} /${distroid} -${distroversioncsv} .csv" <( curl " ${nocache[@]} " --connect-timeout 3 -s " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /lgsm/data/${distroid} -${distroversioncsv} .csv" ) )
182183 else
183- config_file_diff=$( diff " ${datadir} /${distroid} -${distroversioncsv} .csv" <( curl ${nocache} --connect-timeout 3 -s " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /lgsm/data/${distroid} -${distroversioncsv} .csv" ) )
184+ config_file_diff=$( diff " ${datadir} /${distroid} -${distroversioncsv} .csv" <( curl " ${nocache[@]} " --connect-timeout 3 -s " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /lgsm/data/${distroid} -${distroversioncsv} .csv" ) )
184185 fi
185186
186187 if [ " ${config_file_diff} " != " " ]; then
@@ -204,9 +205,9 @@ if [ -n "${modulesdir}" ]; then
204205 echo -en " checking ${remotereponame} module [ ${italic}${modulefile}${default} ]\c"
205206 github_file_url_dir=" lgsm/modules"
206207 if [ " ${remotereponame} " == " GitHub" ]; then
207- curl ${nocache} --connect-timeout 3 -IsfL " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /${github_file_url_dir} /${modulefile} " 1> /dev/null
208+ curl " ${nocache[@]} " --connect-timeout 3 -IsfL " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /${github_file_url_dir} /${modulefile} " 1> /dev/null
208209 else
209- curl ${nocache} --connect-timeout 3 -IsfL " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /${github_file_url_dir} /${modulefile} " 1> /dev/null
210+ curl " ${nocache[@]} " --connect-timeout 3 -IsfL " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /${github_file_url_dir} /${modulefile} " 1> /dev/null
210211 fi
211212 exitcode=$?
212213 if [ " ${exitcode} " -ne 0 ]; then
@@ -224,9 +225,9 @@ if [ -n "${modulesdir}" ]; then
224225 else
225226 # compare file
226227 if [ " ${remotereponame} " == " GitHub" ]; then
227- module_file_diff=$( diff " ${modulesdir} /${modulefile} " <( curl ${nocache} --connect-timeout 3 -s " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /${github_file_url_dir} /${modulefile} " ) )
228+ module_file_diff=$( diff " ${modulesdir} /${modulefile} " <( curl " ${nocache[@]} " --connect-timeout 3 -s " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /${github_file_url_dir} /${modulefile} " ) )
228229 else
229- module_file_diff=$( diff " ${modulesdir} /${modulefile} " <( curl ${nocache} --connect-timeout 3 -s " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /${github_file_url_dir} /${modulefile} " ) )
230+ module_file_diff=$( diff " ${modulesdir} /${modulefile} " <( curl " ${nocache[@]} " --connect-timeout 3 -s " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /${github_file_url_dir} /${modulefile} " ) )
230231 fi
231232
232233 # results
0 commit comments