diff --git a/Dockerfile b/Dockerfile index d29301a..1939964 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,8 @@ ENV PORT=8211 \ PUBLIC_IP= \ PUBLIC_PORT= \ SERVER_PASSWORD= \ - SERVER_NAME= + SERVER_NAME= \ + UPDATE_ON_BOOT=true COPY ./scripts/* /home/steam/server/ RUN chmod +x /home/steam/server/init.sh /home/steam/server/start.sh diff --git a/README.md b/README.md index e29a360..8b21ca1 100644 --- a/README.md +++ b/README.md @@ -75,8 +75,9 @@ It is highly recommended you set the following environment values before startin | COMMUNITY | Whether or not the server shows up in the community server browser (USE WITH SERVER_PASSWORD) | false | true/false | | PUBLIC_IP | You can manually specify the global IP address of the network on which the server running.If not specified, it will be detected automatically. If it does not work well, try manual configuration. | | x.x.x.x | | PUBLIC_PORT | You can manually specify the port number of the network on which the server running.If not specified, it will be detected automatically. If it does not work well, try manual configuration. | | x.x.x.x | -| SERVER_NAME | A name for your community server | | "string" | -| SERVER_PASSWORD | Secure your community server with a password | | "string" | +| SERVER_NAME | A name for your community server | | "string" | +| SERVER_PASSWORD | Secure your community server with a password | | "string" | +| UPDATE_ON_BOOT | Update/Install the server when the docker container starts (THIS HAS TO BE ENABLED THE FIRST TIME YOU RUN THE CONTAINER) | true | true/false | *highly recommended to set diff --git a/docker-compose.yml b/docker-compose.yml index 1c7ecba..dd4ef39 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,6 +10,7 @@ services: - PORT=8211 - PLAYERS=16 - MULTITHREADING=false + - UPDATE_ON_BOOT=true - COMMUNITY=false # Enable this if you want your server to show up in the community servers tab, USE WITH SERVER_PASSWORD! # Enable the environment variables below if you have COMMUNITY=true # - PUBLIC_PORT=123 diff --git a/scripts/init.sh b/scripts/init.sh index 3188541..53918b8 100644 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -1,10 +1,14 @@ #!/bin/sh -printf "\e[0;32m*****STARTING INSTALL/UPDATE*****\e[0m" + mkdir -p /palworld chown -R steam:steam /palworld -/home/steam/steamcmd/steamcmd.sh +force_install_dir "/palworld" +login anonymous +app_update 2394010 validate +quit -# ln -s /home/steam/server/palworld /palworld +if [ "${UPDATE_ON_BOOT}" = true ]; then + + printf "\e[0;32m*****STARTING INSTALL/UPDATE*****\e[0m" + /home/steam/steamcmd/steamcmd.sh +force_install_dir "/palworld" +login anonymous +app_update 2394010 validate +quit + +fi ./start.sh \ No newline at end of file