@@ -15,14 +15,21 @@ check.sh
1515info_distro.sh
1616info_game.sh
1717
18+ # Prevent github from using a cached version of the file if dev-debug is enabled.
19+ if [ -f " ${rootdir} /.dev-debug" ]; then
20+ nocache=" -H \" Cache-Control: no-cache\" -H \" Pragma: no-cache\" "
21+ fi
22+
1823fn_script_log_info " Updating LinuxGSM"
1924
2025fn_print_dots " Selecting repo"
2126fn_script_log_info " Selecting repo"
2227# Select remotereponame
23- curl --connect-timeout 3 -IsfL " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /linuxgsm.sh" 1> /dev/null
28+
29+ curl ${nocache} --connect-timeout 3 -IsfL " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /linuxgsm.sh" 1> /dev/null
30+
2431if [ $? != " 0" ]; then
25- curl --connect-timeout 3 -IsfL " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /linuxgsm.sh" 1> /dev/null
32+ curl curl ${nocache} --connect-timeout 3 -IsfL " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /linuxgsm.sh" 1> /dev/null
2633 if [ $? != " 0" ]; then
2734 fn_print_fail_nl " Selecting repo: Unable to to access GitHub or Bitbucket repositories"
2835 fn_script_log_fail " Selecting repo: Unable to to access GitHub or Bitbucket repositories"
3946# Check linuxsm.sh
4047echo -en " checking ${remotereponame} linuxgsm.sh...\c"
4148if [ " ${remotereponame} " == " GitHub" ]; then
42- curl --connect-timeout 3 -IsfL " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /linuxgsm.sh" 1> /dev/null
49+ curl ${nocache} --connect-timeout 3 -IsfL " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /linuxgsm.sh" 1> /dev/null
4350else
44- curl --connect-timeout 3 -IsfL " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /linuxgsm.sh" 1> /dev/null
51+ curl ${nocache} --connect-timeout 3 -IsfL " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /linuxgsm.sh" 1> /dev/null
4552fi
4653if [ $? != " 0" ]; then
4754 fn_print_fail_eol_nl
@@ -51,9 +58,9 @@ if [ $? != "0" ]; then
5158fi
5259
5360if [ " ${remotereponame} " == " GitHub" ]; then
54- tmp_script_diff=$( diff " ${tmpdir} /linuxgsm.sh" <( curl --connect-timeout 3 -s " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /linuxgsm.sh" ) )
61+ tmp_script_diff=$( diff " ${tmpdir} /linuxgsm.sh" <( curl ${nocache} --connect-timeout 3 -s " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /linuxgsm.sh" ) )
5562else
56- tmp_script_diff=$( diff " ${tmpdir} /linuxgsm.sh" <( curl --connect-timeout 3 -s " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /linuxgsm.sh" ) )
63+ tmp_script_diff=$( diff " ${tmpdir} /linuxgsm.sh" <( curl ${nocache} --connect-timeout 3 -s " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /linuxgsm.sh" ) )
5764fi
5865
5966if [ " ${tmp_script_diff} " != " " ]; then
119126echo -en " checking ${remotereponame} config _default.cfg...\c"
120127fn_script_log_info " Checking ${remotereponame} config _default.cfg"
121128if [ " ${remotereponame} " == " GitHub" ]; then
122- curl --connect-timeout 3 -IsfL " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /lgsm/config-default/config-lgsm/${gameservername} /_default.cfg" 1> /dev/null
129+ curl ${nocache} --connect-timeout 3 -IsfL " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /lgsm/config-default/config-lgsm/${gameservername} /_default.cfg" 1> /dev/null
123130else
124- curl --connect-timeout 3 -IsfL " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /lgsm/config-default/config-lgsm/${gameservername} /_default.cfg" 1> /dev/null
131+ curl ${nocache} --connect-timeout 3 -IsfL " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /lgsm/config-default/config-lgsm/${gameservername} /_default.cfg" 1> /dev/null
125132fi
126133if [ $? != " 0" ]; then
127134 fn_print_fail_eol_nl
@@ -131,9 +138,9 @@ if [ $? != "0" ]; then
131138fi
132139
133140if [ " ${remotereponame} " == " GitHub" ]; then
134- config_file_diff=$( diff " ${configdirdefault} /config-lgsm/${gameservername} /_default.cfg" <( curl --connect-timeout 3 -s " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /lgsm/config-default/config-lgsm/${gameservername} /_default.cfg" ) )
141+ 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" ) )
135142else
136- config_file_diff=$( diff " ${configdirdefault} /config-lgsm/${gameservername} /_default.cfg" <( curl --connect-timeout 3 -s " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /lgsm/config-default/config-lgsm/${gameservername} /_default.cfg" ) )
143+ 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" ) )
137144fi
138145
139146if [ " ${config_file_diff} " != " " ]; then
@@ -153,9 +160,9 @@ if [ -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then
153160 echo -en " checking ${remotereponame} config ${distroid} -${distroversioncsv} .csv...\c"
154161 fn_script_log_info " Checking ${remotereponame} ${distroid} -${distroversioncsv} .csv"
155162 if [ " ${remotereponame} " == " GitHub" ]; then
156- curl --connect-timeout 3 -IsfL " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /lgsm/data/${distroid} -${distroversioncsv} .csv" 1> /dev/null
163+ curl ${nocache} --connect-timeout 3 -IsfL " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /lgsm/data/${distroid} -${distroversioncsv} .csv" 1> /dev/null
157164 else
158- curl --connect-timeout 3 -IsfL " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /lgsm/data/${distroid} -${distroversioncsv} .csv" 1> /dev/null
165+ curl ${nocache} --connect-timeout 3 -IsfL " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /lgsm/data/${distroid} -${distroversioncsv} .csv" 1> /dev/null
159166 fi
160167 if [ $? != " 0" ]; then
161168 fn_print_fail_eol_nl
@@ -165,9 +172,9 @@ if [ -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then
165172 fi
166173
167174 if [ " ${remotereponame} " == " GitHub" ]; then
168- config_file_diff=$( diff " ${datadir} /${distroid} -${distroversioncsv} .csv" <( curl --connect-timeout 3 -s " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /lgsm/data/${distroid} -${distroversioncsv} .csv" ) )
175+ 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" ) )
169176 else
170- config_file_diff=$( diff " ${datadir} /${distroid} -${distroversioncsv} .csv" <( curl --connect-timeout 3 -s " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /lgsm/data/${distroid} -${distroversioncsv} .csv" ) )
177+ 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" ) )
171178 fi
172179
173180 if [ " ${config_file_diff} " != " " ]; then
@@ -191,9 +198,9 @@ if [ -n "${modulesdir}" ]; then
191198 echo -en " checking ${remotereponame} module ${modulefile} ...\c"
192199 github_file_url_dir=" lgsm/modules"
193200 if [ " ${remotereponame} " == " GitHub" ]; then
194- curl --connect-timeout 3 -IsfL " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /${github_file_url_dir} /${modulefile} " 1> /dev/null
201+ curl ${nocache} --connect-timeout 3 -IsfL " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /${github_file_url_dir} /${modulefile} " 1> /dev/null
195202 else
196- curl --connect-timeout 3 -IsfL " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /${github_file_url_dir} /${modulefile} " 1> /dev/null
203+ curl ${nocache} --connect-timeout 3 -IsfL " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /${github_file_url_dir} /${modulefile} " 1> /dev/null
197204 fi
198205 if [ $? != 0 ]; then
199206 fn_print_error_eol_nl
@@ -210,9 +217,9 @@ if [ -n "${modulesdir}" ]; then
210217 else
211218 # compare file
212219 if [ " ${remotereponame} " == " GitHub" ]; then
213- module_file_diff=$( diff " ${modulesdir} /${modulefile} " <( curl --connect-timeout 3 -s " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /${github_file_url_dir} /${modulefile} " ) )
220+ module_file_diff=$( diff " ${modulesdir} /${modulefile} " <( curl ${nocache} --connect-timeout 3 -s " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /${github_file_url_dir} /${modulefile} " ) )
214221 else
215- module_file_diff=$( diff " ${modulesdir} /${modulefile} " <( curl --connect-timeout 3 -s " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /${github_file_url_dir} /${modulefile} " ) )
222+ module_file_diff=$( diff " ${modulesdir} /${modulefile} " <( curl ${nocache} --connect-timeout 3 -s " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /${github_file_url_dir} /${modulefile} " ) )
216223 fi
217224
218225 # results
0 commit comments