@@ -15,14 +15,21 @@ check.sh
15
15
info_distro.sh
16
16
info_game.sh
17
17
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
+
18
23
fn_script_log_info " Updating LinuxGSM"
19
24
20
25
fn_print_dots " Selecting repo"
21
26
fn_script_log_info " Selecting repo"
22
27
# 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
+
24
31
if [ $? != " 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
26
33
if [ $? != " 0" ]; then
27
34
fn_print_fail_nl " Selecting repo: Unable to to access GitHub or Bitbucket repositories"
28
35
fn_script_log_fail " Selecting repo: Unable to to access GitHub or Bitbucket repositories"
39
46
# Check linuxsm.sh
40
47
echo -en " checking ${remotereponame} linuxgsm.sh...\c"
41
48
if [ " ${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
43
50
else
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
45
52
fi
46
53
if [ $? != " 0" ]; then
47
54
fn_print_fail_eol_nl
@@ -51,9 +58,9 @@ if [ $? != "0" ]; then
51
58
fi
52
59
53
60
if [ " ${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" ) )
55
62
else
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" ) )
57
64
fi
58
65
59
66
if [ " ${tmp_script_diff} " != " " ]; then
119
126
echo -en " checking ${remotereponame} config _default.cfg...\c"
120
127
fn_script_log_info " Checking ${remotereponame} config _default.cfg"
121
128
if [ " ${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
123
130
else
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
125
132
fi
126
133
if [ $? != " 0" ]; then
127
134
fn_print_fail_eol_nl
@@ -131,9 +138,9 @@ if [ $? != "0" ]; then
131
138
fi
132
139
133
140
if [ " ${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" ) )
135
142
else
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" ) )
137
144
fi
138
145
139
146
if [ " ${config_file_diff} " != " " ]; then
@@ -153,9 +160,9 @@ if [ -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then
153
160
echo -en " checking ${remotereponame} config ${distroid} -${distroversioncsv} .csv...\c"
154
161
fn_script_log_info " Checking ${remotereponame} ${distroid} -${distroversioncsv} .csv"
155
162
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
157
164
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
159
166
fi
160
167
if [ $? != " 0" ]; then
161
168
fn_print_fail_eol_nl
@@ -165,9 +172,9 @@ if [ -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then
165
172
fi
166
173
167
174
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" ) )
169
176
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" ) )
171
178
fi
172
179
173
180
if [ " ${config_file_diff} " != " " ]; then
@@ -191,9 +198,9 @@ if [ -n "${modulesdir}" ]; then
191
198
echo -en " checking ${remotereponame} module ${modulefile} ...\c"
192
199
github_file_url_dir=" lgsm/modules"
193
200
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
195
202
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
197
204
fi
198
205
if [ $? != 0 ]; then
199
206
fn_print_error_eol_nl
@@ -210,9 +217,9 @@ if [ -n "${modulesdir}" ]; then
210
217
else
211
218
# compare file
212
219
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} " ) )
214
221
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} " ) )
216
223
fi
217
224
218
225
# results
0 commit comments