Browse Source

feat:add version and port details to lockfile

pull/3120/head
Daniel Gibbs 4 years ago
parent
commit
0b38915f03
  1. 2
      lgsm/functions/command_debug.sh
  2. 4
      lgsm/functions/command_monitor.sh
  3. 2
      lgsm/functions/command_start.sh
  4. 2
      tests/tests_fctrserver.sh
  5. 2
      tests/tests_jc2server.sh
  6. 2
      tests/tests_mcserver.sh
  7. 2
      tests/tests_ts3server.sh

2
lgsm/functions/command_debug.sh

@ -95,6 +95,8 @@ fn_print_ok_nl "Starting debug"
# Create lockfile.
date '+%s' > "${lockdir}/${selfname}.lock"
echo "${version}" >> "${lockdir}/${selfname}.lock"
echo "${port}" >> "${lockdir}/${selfname}.lock"
fn_script_log_info "Lockfile generated"
fn_script_log_info "${lockdir}/${selfname}.lock"

4
lgsm/functions/command_monitor.sh

@ -25,8 +25,10 @@ fn_monitor_check_lockfile(){
fi
# Fix if lockfile is not unix time or contains letters
if [ -f "${lockdir}/${selfname}.lock" ]&&[[ "$(cat "${lockdir}/${selfname}.lock")" =~ [A-Za-z] ]]; then
if [ -f "${lockdir}/${selfname}.lock" ]&&[[ "$(head -n 1 "${lockdir}/${selfname}.lock")" =~ [A-Za-z] ]]; then
date '+%s' > "${lockdir}/${selfname}.lock"
echo "${version}" >> "${lockdir}/${selfname}.lock"
echo "${port}" >> "${lockdir}/${selfname}.lock"
fi
}

2
lgsm/functions/command_start.sh

@ -71,6 +71,8 @@ fn_start_tmux(){
# Create lockfile
date '+%s' > "${lockdir}/${selfname}.lock"
echo "${version}" >> "${lockdir}/${selfname}.lock"
echo "${port}" >> "${lockdir}/${selfname}.lock"
cd "${executabledir}" || exit
tmux new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${sessionname}" "${executable} ${parms}" 2> "${lgsmlogdir}/.${selfname}-tmux-error.tmp"

2
tests/tests_fctrserver.sh

@ -938,6 +938,8 @@ requiredstatus="OFFLINE"
fn_setstatus
fn_print_info_nl "creating lockfile."
date '+%s' > "${lockdir}/${selfname}.lock"
echo "${version}" >> "${lockdir}/${selfname}.lock"
echo "${port}" >> "${lockdir}/${selfname}.lock"
(
exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
BASH_XTRACEFD="5"

2
tests/tests_jc2server.sh

@ -1097,6 +1097,8 @@ requiredstatus="OFFLINE"
fn_setstatus
fn_print_info_nl "creating lockfile."
date '+%s' > "${lockdir}/${selfname}.lock"
echo "${version}" >> "${lockdir}/${selfname}.lock"
echo "${port}" >> "${lockdir}/${selfname}.lock"
(
exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
BASH_XTRACEFD="5"

2
tests/tests_mcserver.sh

@ -970,6 +970,8 @@ requiredstatus="OFFLINE"
fn_setstatus
fn_print_info_nl "creating lockfile."
date '+%s' > "${lockdir}/${selfname}.lock"
echo "${version}" >> "${lockdir}/${selfname}.lock"
echo "${port}" >> "${lockdir}/${selfname}.lock"
(
exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
BASH_XTRACEFD="5"

2
tests/tests_ts3server.sh

@ -937,6 +937,8 @@ requiredstatus="OFFLINE"
fn_setstatus
fn_print_info_nl "creating lockfile."
date '+%s' > "${lockdir}/${selfname}.lock"
echo "${version}" >> "${lockdir}/${selfname}.lock"
echo "${port}" >> "${lockdir}/${selfname}.lock"
(
exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
BASH_XTRACEFD="5"

Loading…
Cancel
Save