Skip to content

Instantly share code, notes, and snippets.

@audstanley
Last active August 27, 2022 16:56
Show Gist options
  • Save audstanley/1d057921fed575b9176d526b004530b8 to your computer and use it in GitHub Desktop.
Save audstanley/1d057921fed575b9176d526b004530b8 to your computer and use it in GitHub Desktop.
Project Zomboid Linux Dedicated server beta 41 multiplayer files for systemd
#!/bin/bash
# this is basically just a helper script for systemd
# This file should be locaed in: /home/audstanley/Zomboid [match to your user's directory]
cd /home/audstanley/.steam/steamapps/common/Project\ Zomboid\ Dedicated\ Server;
./start-server.sh
#!/bin/bash
# for backups, I put this script in the /home/audstanley/Zomboid/Saves/Multiplayer directory
# games are tar filed every 15 minutes. Just check timestamps if you want to roll back.
while :
do
ls -la /home/audstanley/Zomboid/Saves/Multiplayer | awk '{print $9}' | grep -P "servertest" | tar -cvf allfiles-$(($(date +"%H:%M" | cut -c4-5) % 4)).tar -T -
# every 15 minutes.
sleep 900
done
#!/bin/bash
# copy this file to /usr/local/bin/update-pz
# chmod +x /usr/local/bin/update-pz # to make it executable
steamcmd +login anonymous +app_update 380870 -beta b41multiplayer +quit
systemctl restart zomboid.service
systemctl status zomboid.service
# when there are updates to the game, you can just run: update-pz
[Unit]
Description=Project Zomboid Service
Wants=network.target
After=syslog.target network-online.target
[Service]
Type=simple
Restart=on-failure
RestartSec=10
# change the HOME directory needs to change also
WorkingDirectory=/home/audstanley/Zomboid
ExecStart=/bin/bash /home/audstanley/Zomboid/audstanley-start-server.sh
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment