Browse Source

If legacymode is on then bypass certain updates

pull/1477/head
Daniel Gibbs 8 years ago
parent
commit
68e4f8ef9d
  1. 32
      lgsm/functions/command_update_linuxgsm.sh

32
lgsm/functions/command_update_linuxgsm.sh

@ -14,34 +14,35 @@ check.sh
fn_script_log_info "Updating LinuxGSM" fn_script_log_info "Updating LinuxGSM"
echo -ne "\n" echo -ne "\n"
# Check and update _default.cfg if [ -z "${legacymode}" ];then
echo -ne " checking config _default.cfg...\c" # Check and update _default.cfg
config_file_diff=$(diff "${configdirdefault}/config-lgsm/${servername}/_default.cfg" <(${curlpath} -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${servername}/_default.cfg")) echo -ne " checking config _default.cfg...\c"
if [ "${config_file_diff}" != "" ]; then config_file_diff=$(diff "${configdirdefault}/config-lgsm/${servername}/_default.cfg" <(${curlpath} -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${servername}/_default.cfg"))
if [ "${config_file_diff}" != "" ]; then
fn_print_update_eol_nl fn_print_update_eol_nl
fn_script_log_info "checking config _default.cfg: UPDATE" fn_script_log_info "checking config _default.cfg: UPDATE"
rm -f "${configdirdefault}/config-lgsm/${servername}/_default.cfg" rm -f "${configdirdefault}/config-lgsm/${servername}/_default.cfg"
fn_fetch_config "lgsm/config-default/config-lgsm/${servername}" "_default.cfg" "${configdirdefault}/config-lgsm/${servername}" "_default.cfg" "nochmodx" "norun" "noforce" "nomd5" fn_fetch_config "lgsm/config-default/config-lgsm/${servername}" "_default.cfg" "${configdirdefault}/config-lgsm/${servername}" "_default.cfg" "nochmodx" "norun" "noforce" "nomd5"
else else
fn_print_ok_eol_nl fn_print_ok_eol_nl
fn_script_log_info "checking config _default.cfg: OK" fn_script_log_info "checking config _default.cfg: OK"
fi fi
echo -ne " checking linuxgsm.sh...\c" echo -ne " checking linuxgsm.sh...\c"
tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(${curlpath} -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh")) tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(${curlpath} -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh"))
if [ "${tmp_script_diff}" != "" ]; then if [ "${tmp_script_diff}" != "" ]; then
fn_print_update_eol_nl fn_print_update_eol_nl
fn_script_log_info "checking linuxgsm.sh: UPDATE" fn_script_log_info "checking linuxgsm.sh: UPDATE"
rm -f "${tmpdir}/linuxgsm.sh" rm -f "${tmpdir}/linuxgsm.sh"
fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "nochmodx" "norun" "noforcedl" "nomd5" fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "nochmodx" "norun" "noforcedl" "nomd5"
# Compare selfname against linuxgsm.sh in the tmp dir. Ignoring server specific vars. # Compare selfname against linuxgsm.sh in the tmp dir. Ignoring server specific vars.
else else
fn_script_log_info "checking linuxgsm.sh: OK" fn_script_log_info "checking linuxgsm.sh: OK"
fn_print_ok_eol_nl fn_print_ok_eol_nl
fi fi
echo -ne " checking ${selfname}...\c" echo -ne " checking ${selfname}...\c"
script_diff=$(diff <(sed '/shortname/d;/servername/d;/gamename/d' "${tmpdir}/linuxgsm.sh") <(sed '/shortname/d;/servername/d;/gamename/d' "${rootdir}/${selfname}")) script_diff=$(diff <(sed '/shortname/d;/servername/d;/gamename/d' "${tmpdir}/linuxgsm.sh") <(sed '/shortname/d;/servername/d;/gamename/d' "${rootdir}/${selfname}"))
if [ "${script_diff}" != "" ]; then if [ "${script_diff}" != "" ]; then
fn_print_update_eol_nl fn_print_update_eol_nl
echo -ne " backup ${selfname}...\c" echo -ne " backup ${selfname}...\c"
mkdir -p "${backupdir}/script/" mkdir -p "${backupdir}/script/"
@ -64,8 +65,9 @@ if [ "${script_diff}" != "" ]; then
else else
fn_print_ok_eol_nl fn_print_ok_eol_nl
fi fi
else else
fn_print_ok_eol_nl fn_print_ok_eol_nl
fi
fi fi
# Check and update functions # Check and update functions

Loading…
Cancel
Save