change variable names and directory to file check
All checks were successful
Deploy / BuildandPush-Docker (push) Successful in 5m0s

This commit is contained in:
tueem 2024-10-21 03:40:50 +02:00
parent 377fb9e2f0
commit 7704abb39d
No known key found for this signature in database
GPG Key ID: 819A0F7C36B9CF07

@ -1,24 +1,24 @@
#!/bin/bash #!/bin/bash
INI_DIRECTORY="Archean-data/server/server.ini" SERVER_INI="Archean-data/server/server.ini"
ADMINS_DIRECTORY="Archean-data/server/admins.txt" ADMINS_TXT="Archean-data/server/admins.txt"
if [ ! -d "$INI_DIRECTORY" ]; then if [ ! -e "$SERVER_INI" ]; then
curl -o "$INI_DIRECTORY" --create-dirs https://git.tomatentum.net/tueem/archean-server-pelican/raw/branch/master/server.ini curl -o "$SERVER_INI" --create-dirs https://git.tomatentum.net/tueem/archean-server-pelican/raw/branch/master/server.ini
fi fi
echo "$ADMINS" > "$ADMINS_DIRECTORY" echo "$ADMINS" > "$ADMINS_TXT"
sed -i "s/^game_mode=.*/game_mode=$( [ "$GAME_MODE" = "creative" ] && echo 0 || echo 1)/" "$INI_DIRECTORY" sed -i "s/^game_mode=.*/game_mode=$( [ "$GAME_MODE" = "creative" ] && echo 0 || echo 1)/" "$SERVER_INI"
sed -i "s/^server_online=.*/server_online=$( [ "$ONLINE_MODE" = "0" ] && echo no || echo yes)/" "$INI_DIRECTORY" sed -i "s/^server_online=.*/server_online=$( [ "$ONLINE_MODE" = "0" ] && echo no || echo yes)/" "$SERVER_INI"
sed -i "s/^max_simultaneous_players=.*/max_simultaneous_players=$MAX_PLAYERS/" "$INI_DIRECTORY" sed -i "s/^max_simultaneous_players=.*/max_simultaneous_players=$MAX_PLAYERS/" "$SERVER_INI"
sed -i "s/^password=.*/password=$PASSWORD/" "$INI_DIRECTORY" sed -i "s/^password=.*/password=$PASSWORD/" "$SERVER_INI"
sed -i "s/^server_public_name=.*/server_public_name=$SERVER_NAME/" "$INI_DIRECTORY" sed -i "s/^server_public_name=.*/server_public_name=$SERVER_NAME/" "$SERVER_INI"
sed -i "s/^listen_port=.*/listen_port=$SERVER_PORT/" "$INI_DIRECTORY" sed -i "s/^listen_port=.*/listen_port=$SERVER_PORT/" "$SERVER_INI"
sed -i "s/^spawn=.*/spawn=$SPAWN_PLANET/" "$INI_DIRECTORY" sed -i "s/^spawn=.*/spawn=$SPAWN_PLANET/" "$SERVER_INI"
sed -i "s/^auto_save_interval_seconds=.*/auto_save_interval_seconds=$AUTOSAVE_INTERVAL/" "$INI_DIRECTORY" sed -i "s/^auto_save_interval_seconds=.*/auto_save_interval_seconds=$AUTOSAVE_INTERVAL/" "$SERVER_INI"
sed -i "s/^updates_per_second=.*/updates_per_second=$UPDATES_PER_SECOND/" "$INI_DIRECTORY" sed -i "s/^updates_per_second=.*/updates_per_second=$UPDATES_PER_SECOND/" "$SERVER_INI"
sed -i "s/^physics_steps_per_update=.*/physics_steps_per_update=$PHYSICS_UPDATES_PER_UPDATE/" "$INI_DIRECTORY" sed -i "s/^physics_steps_per_update=.*/physics_steps_per_update=$PHYSICS_UPDATES_PER_UPDATE/" "$SERVER_INI"
cd Archean-server-alpha cd Archean-server-alpha
./Archean server ./Archean server