Skip to content

Commit

Permalink
Shutdown cleanly
Browse files Browse the repository at this point in the history
  • Loading branch information
lloesche committed Feb 6, 2021
1 parent cdb2522 commit 135907e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion valheim-server
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ main() {
fi
done
echo "Running Valheim Server"
exec "$valheim_server" -name "$SERVER_NAME" -port $SERVER_PORT -world "$WORLD_NAME" -password "$SERVER_PASS" -public $SERVER_PUBLIC
"$valheim_server" -name "$SERVER_NAME" -port $SERVER_PORT -world "$WORLD_NAME" -password "$SERVER_PASS" -public $SERVER_PUBLIC
}

shutdown() {
echo "Shutting down Valheim Server"
echo 1 > /opt/valheim/server_exit.drp
}

trap shutdown SIGINT SIGTERM
main

0 comments on commit 135907e

Please sign in to comment.