Suffix autostart and autorestart with instance name

This commit is contained in:
Ben Peddell 2016-09-17 19:55:07 +10:00
parent 8c05d7bf1e
commit bd5ef349bc

View File

@ -148,7 +148,6 @@ arkserverLog="arkserver.log" # here is logged the output of ShooterGameServer
appid="${appid:-376030}" appid="${appid:-376030}"
mod_appid="${mod_appid:-346110}" mod_appid="${mod_appid:-346110}"
arkautorestartfile="${arkautorestartfile:-ShooterGame/Saved/.autorestart}"
install_bindir="${install_bindir:-${0%/*}}" install_bindir="${install_bindir:-${0%/*}}"
install_libexecdir="${install_libexecdir:-${install_bindir%/*}/libexec/arkmanager}" install_libexecdir="${install_libexecdir:-${install_bindir%/*}/libexec/arkmanager}"
@ -736,7 +735,7 @@ doRun() {
# start function # start function
# #
doStart() { doStart() {
touch "${arkserverroot}/.startAfterUpdate" touch "${arkserverroot}/.startAfterUpdate-${instance}"
if [ -f "${arkserverroot}/.ark-update.lock" ]; then if [ -f "${arkserverroot}/.ark-update.lock" ]; then
local updatepid="$(<"${arkserverroot}/.ark-update.lock")" local updatepid="$(<"${arkserverroot}/.ark-update.lock")"
@ -785,7 +784,7 @@ doStartAll(){
# #
doStop() { doStop() {
if [ "$1" != "update" ]; then if [ "$1" != "update" ]; then
rm -f "${arkserverroot}/.startAfterUpdate" rm -f "${arkserverroot}/.startAfterUpdate-${instance}"
fi fi
if isTheServerRunning; then if isTheServerRunning; then
@ -1184,8 +1183,8 @@ doUpdate() {
rm -f "${arkserverroot}/.ark-update.lock" rm -f "${arkserverroot}/.ark-update.lock"
# we restart the server only if it was started before the update # we restart the server only if it was started before the update
if [ -z "$noautostart" ]; then if [ -z "$noautostart" ]; then
if [ $serverWasAlive -eq 1 ] || [ -f "${arkserverroot}/.startAfterUpdate" ]; then if [ $serverWasAlive -eq 1 ] || [ -f "${arkserverroot}/.startAfterUpdate-${instance}" ]; then
rm -f "${arkserverroot}/.startAfterUpdate" rm -f "${arkserverroot}/.startAfterUpdate-${instance}"
rm -f "${arkserverroot}/.ark-update.lock" rm -f "${arkserverroot}/.ark-update.lock"
doStart --noautoupdate doStart --noautoupdate
fi fi
@ -1725,6 +1724,7 @@ useConfig() {
echo "Error: arkserverroot not set" echo "Error: arkserverroot not set"
exit 1 exit 1
fi fi
arkautorestartfile="${arkautorestartfile:-ShooterGame/Saved/.autorestart-${1}}"
} }
showUsage() { showUsage() {