|
|
@@ -17,9 +17,9 @@ fn_script_log_info "Updating LinuxGSM"
|
|
|
fn_print_dots "Selecting repo"
|
|
|
fn_script_log_info "Selecting repo"
|
|
|
# Select remotereponame
|
|
|
-curl -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1>/dev/null
|
|
|
+curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1>/dev/null
|
|
|
if [ $? != "0" ]; then
|
|
|
- curl -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1>/dev/null
|
|
|
+ curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1>/dev/null
|
|
|
if [ $? != "0" ]; then
|
|
|
fn_print_fail_nl "Selecting repo: Unable to to access GitHub or Bitbucket repositories"
|
|
|
fn_script_log_fatal "Selecting repo: Unable to to access GitHub or Bitbucket repositories"
|
|
|
@@ -36,9 +36,9 @@ fi
|
|
|
# Check linuxsm.sh
|
|
|
echo -en "checking ${remotereponame} linuxgsm.sh...\c"
|
|
|
if [ "${remotereponame}" == "GitHub" ]; then
|
|
|
- curl -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1>/dev/null
|
|
|
+ curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1>/dev/null
|
|
|
else
|
|
|
- curl -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1>/dev/null
|
|
|
+ curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1>/dev/null
|
|
|
fi
|
|
|
if [ $? != "0" ]; then
|
|
|
fn_print_fail_eol_nl
|
|
|
@@ -48,9 +48,9 @@ if [ $? != "0" ]; then
|
|
|
fi
|
|
|
|
|
|
if [ "${remotereponame}" == "GitHub" ]; then
|
|
|
- tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh"))
|
|
|
+ tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl --connect-timeout 10 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh"))
|
|
|
else
|
|
|
- tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh"))
|
|
|
+ tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl --connect-timeout 10 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh"))
|
|
|
fi
|
|
|
|
|
|
if [ "${tmp_script_diff}" != "" ]; then
|
|
|
@@ -116,9 +116,9 @@ fi
|
|
|
echo -en "checking ${remotereponame} config _default.cfg...\c"
|
|
|
fn_script_log_info "Checking ${remotereponame} config _default.cfg"
|
|
|
if [ "${remotereponame}" == "GitHub" ]; then
|
|
|
- curl -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null
|
|
|
+ curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null
|
|
|
else
|
|
|
- curl -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null
|
|
|
+ curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null
|
|
|
fi
|
|
|
if [ $? != "0" ]; then
|
|
|
fn_print_fail_eol_nl
|
|
|
@@ -128,9 +128,9 @@ if [ $? != "0" ]; then
|
|
|
fi
|
|
|
|
|
|
if [ "${remotereponame}" == "GitHub" ]; then
|
|
|
- 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"))
|
|
|
+ config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl --connect-timeout 10 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg"))
|
|
|
else
|
|
|
- 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"))
|
|
|
+ config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl --connect-timeout 10 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg"))
|
|
|
fi
|
|
|
|
|
|
if [ "${config_file_diff}" != "" ]; then
|
|
|
@@ -155,9 +155,9 @@ if [ -n "${functionsdir}" ]; then
|
|
|
echo -en "checking ${remotereponame} module ${functionfile}...\c"
|
|
|
github_file_url_dir="lgsm/functions"
|
|
|
if [ "${remotereponame}" == "GitHub" ]; then
|
|
|
- curl -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}" 1>/dev/null
|
|
|
+ curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}" 1>/dev/null
|
|
|
else
|
|
|
- curl -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${functionfile}" 1>/dev/null
|
|
|
+ curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${functionfile}" 1>/dev/null
|
|
|
fi
|
|
|
if [ $? != 0 ]; then
|
|
|
fn_print_error_eol_nl
|
|
|
@@ -174,9 +174,9 @@ if [ -n "${functionsdir}" ]; then
|
|
|
else
|
|
|
# compare file
|
|
|
if [ "${remotereponame}" == "GitHub" ]; then
|
|
|
- function_file_diff=$(diff "${functionsdir}/${functionfile}" <(curl -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}"))
|
|
|
+ function_file_diff=$(diff "${functionsdir}/${functionfile}" <(curl --connect-timeout 10 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}"))
|
|
|
else
|
|
|
- function_file_diff=$(diff "${functionsdir}/${functionfile}" <(curl -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${functionfile}"))
|
|
|
+ function_file_diff=$(diff "${functionsdir}/${functionfile}" <(curl --connect-timeout 10 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${functionfile}"))
|
|
|
fi
|
|
|
|
|
|
# results
|