ryansheehan/terraria

-motd option

revilofr opened this issue · 4 comments

Hi Ryan,

Thanks a lot for this Docker image. Working really fine for me.
Anyway would it be possible to add a --motd option to have the possibility to provide our own motd file ?

Thanks a lot !
Have a great day !

I did a script to update the file inside the container. It seams to work. The file is updated.

But the server doesn't seem to refresh. Anyway thx for you answer. I'll let you know if I figure how to do it :).

Hi, I use podman but it is very similure to docker, I changed my MOTD by
podman exec -it ID /bin/sh #replace podman with docker
cd /
cd world
apt-get install nano
nano motd.txt

Did not have to restart just opened terraria and it was changed.

I suspect that the last update made 3 hours ago made the magic happend : here is my scripts :

update_motd.sh

`
#!/bin/sh

CONTAINER_NAME="terraria"
LOCAL_MOTD_PATH="$HOME/terraria/tshock"
WORLDS_PATH="/root/.local/share/Terraria/Worlds"
now=$(date '+%Y%m%d%H%M%s')
motd_filename=$now-motd.txt

echo "Saving previous message of the day into $LOCAL_MOTD_PATH/$motd_filename..."
docker cp $CONTAINER_NAME:$WORLDS_PATH/motd.txt $LOCAL_MOTD_PATH/$motd_filename
echo "Updating the message of the day with the new one..."
docker cp $LOCAL_MOTD_PATH/motd.txt $CONTAINER_NAME:$WORLDS_PATH/motd.txt
echo "Message of the day has been updated"`

Then just make sure that the motd.txt file is here : $HOME/terraria/tshock
And call it like that ./update_motd.sh

Thanks a lot, have a nice day !