diff --git a/docker/src/s6-services/s6-init-dcs-server-autostart-longrun/run b/docker/src/s6-services/s6-init-dcs-server-autostart-longrun/run index ac86182..b8aafb2 100755 --- a/docker/src/s6-services/s6-init-dcs-server-autostart-longrun/run +++ b/docker/src/s6-services/s6-init-dcs-server-autostart-longrun/run @@ -32,6 +32,15 @@ if [ "$AUTOSTART" -ne 1 ]; then exit 1 fi +dcs_lock_file="${DCS_saved_games_dir_current}/dcs.lock" +if [ -f "$dcs_lock_file" ]; then + MSG="Error: File '$dcs_lock_file' is present. Server is already running or lockfile must be manually removed by user. Cannot autostart. Exiting." + echo -e "${MSG}" + /app/dcs_server/display_GUI_warning_function "$MSG" + sleep $TIMEOUT + exit 1 +fi + network_vault_path="${DCS_saved_games_dir_current}/Config/network.vault" if [ ! -f "$network_vault_path" ]; then MSG="Error: File '$network_vault_path' does not exist. Cannot autostart without user logging in and saving credentials for autologin. Exiting."