Browse Source

Further improvements

pull/1477/head
Daniel Gibbs 8 years ago
parent
commit
c5756d8e84
  1. 12
      lgsm/functions/command_update_functions.sh

12
lgsm/functions/command_update_functions.sh

@ -34,8 +34,9 @@ if [ "${tmp_script_diff}" != "" ]; then
rm -f "${tmpdir}/linuxgsm.sh"
fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "linuxgsm.sh" "noexecutecmd" "norun" "noforce" "nomd5"
# Compare selfname against linuxgsm.sh in the tmp dir. Ignoring server specific vars.
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
fi
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
echo -ne " backup linuxgsm.sh...\c"
cp "${rootdir}/${selfname}" "${tmpdir}/${selfname}-$(date +"%m_%d_%Y_%M").bak"
if [ $? -ne 0 ]; then
@ -45,15 +46,14 @@ if [ "${tmp_script_diff}" != "" ]; then
fn_print_ok_eol_nl
echo -en "${tmpdir}/${selfname}-$(date +"%m_%d_%Y_%M").bak"
fi
copyshortname="$(grep -m 1 shortname=)" "${rootdir}/${selfname}"
copyservername="$(grep -m 1 servername=)" "${rootdir}/${selfname}"
copygamename="$(grep -m 1 gamename=)" "${rootdir}/${selfname}"
copyshortname="$(grep -m 1 shortname= "${rootdir}/${selfname}")"
copyservername="$(grep -m 1 servername= "${rootdir}/${selfname}")"
copygamename="$(grep -m 1 gamename= "${rootdir}/${selfname}")"
cp "${tmpdir}/linuxgsm.sh" "${rootdir}/${selfname}"
sed -i 's/shortname="core"/${copyshortname}/g' "${rootdir}/${selfname}"
sed -i 's/shortname="core"/${copyshortname}/g' "${rootdir}/${selfname}"
sed -i 's/shortname="core"/${copyshortname}/g' "${rootdir}/${selfname}"
fi
else
fn_print_ok_eol_nl
fi

Loading…
Cancel
Save