Skip to content

Commit

Permalink
refactor: remove some legacy code
Browse files Browse the repository at this point in the history
A lot of time has passed on many of these changes. Moving old legacy code conversions
  • Loading branch information
dgibbs64 committed Oct 22, 2023
1 parent 16d1af4 commit d93f83f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 72 deletions.
2 changes: 1 addition & 1 deletion lgsm/modules/command_send.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if [ "${status}" != "0" ]; then
fi
echo ""
fn_print_dots "Sending command to console: \"${commandtosend}\""
tmux -L "${socketname}" send-keys -t "${servicename}" "${commandtosend}" ENTER
tmux -L "${socketname}" send-keys -t "${sessionname}" "${commandtosend}" ENTER
fn_print_ok_nl "Sending command to console: \"${commandtosend}\""
fn_script_log_pass "Command \"${commandtosend}\" sent to console"
else
Expand Down
71 changes: 0 additions & 71 deletions lgsm/modules/core_legacy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@

moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"

# This is to help the transition to v20.3.0 and above
legacy_versions_array=(v20.2.1 v20.2.0 v20.1.5 v20.1.4 v20.1.3 v20.1.2 v20.1.1 v20.1.0 v19.12.5 v19.12.4 v19.12.3 v19.12.2 v19.12.1 v19.12.0)
for legacy_version in "${legacy_versions_array[@]}"; do
if [ "${version}" == "${legacy_version}" ]; then
legacymode=1
fi
done

if [ -z "${socketname}" ]; then
socketname="${sessionname}"
fi
Expand Down Expand Up @@ -43,69 +35,6 @@ if [ -n "${autosaveinterval}" ]; then
saveinterval="${autosaveinterval}"
fi

if [ -z "${serverfiles}" ]; then
serverfiles="${filesdir}"
fi

if [ -z "${logdir}" ]; then
[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log"
fi

if [ -z "${lgsmlogdir}" ]; then
lgsmlogdir="${scriptlogdir}"
fi

if [ -z "${lgsmlog}" ]; then
lgsmlog="${scriptlog}"
fi

if [ -z "${lgsmlogdate}" ]; then
lgsmlogdate="${scriptlogdate}"
fi

if [ -z "${steamcmddir}" ]; then
steamcmddir="${HOME}/.steam/steamcmd"
fi

if [ -z "${lgsmdir}" ]; then
lgsmdir="${rootdir}/lgsm"
fi

if [ -z "${tmpdir}" ]; then
tmpdir="${lgsmdir}/tmp"
fi

if [ -z "${alertlog}" ]; then
alertlog="${emaillog}"
fi

if [ -z "${servicename}" ]; then
servicename="${selfname}"
fi

# Alternations to workshop variables.
if [ -z "${wsapikey}" ]; then
if [ "${workshopauth}" ]; then
wsapikey="${workshopauth}"
elif [ "${authkey}" ]; then
wsapikey="${authkey}"
fi
fi

if [ -z "${wscollectionid}" ]; then
if [ "${workshopauth}" ]; then
wscollectionid="${ws_collection_id}"
elif [ "${authkey}" ]; then
wscollectionid="${workshopcollectionid}"
fi
fi

if [ -z "${wsstartmap}" ]; then
if [ "${ws_start_map}" ]; then
wscollectionid="${ws_start_map}"
fi
fi

# Added as part of migrating functions dir to modules dir.
# Will remove functions dir if files in modules dir older than 14 days
functionsdir="${lgsmdir}/modules"
Expand Down

0 comments on commit d93f83f

Please sign in to comment.