Constructive feedback is appreciated.

#!/bin/bash

FILE=docker-compose.yml

if [ -f "$FILE" ]; then
	rm $FILE
	wget https://raw.githubusercontent.com/LemmyNet/lemmy/main/docker/prod/docker-compose.yml
else
	echo "$FILE does not exist. Creating $FILE now..."
	wget https://raw.githubusercontent.com/LemmyNet/lemmy/main/docker/prod/docker-compose.yml
fi
@ksynwa@lemmy.ml
link
fedilink
5ā€¢10 hilabete

You can download it to a temporary location (using mktemp), then compare the checksums of the existing and downloaded files, and move the file from temporary location to $FILE if the checksum is different. This is not necessary though since docker-compose can tell if the compose file has changed, but it will be helpful to the user to know whether they have downloaded an updated file or not.

@nutomic@lemmy.ml
mod
link
fedilink
2ā€¢10 hilabete

I would recommend that you use our ansible playbook instead. It does this and a lot more.

Dessalines
link
fedilink
3ā€¢10 hilabete

@seahorse@lemmy.ml and then after you get ansible set up, the update script would be as simple as:

git pull
ansible-playbook -i inventory/hosts lemmy.yml --become
@hello_lebbit@lemmy.ml
link
fedilink
2ā€¢10 hilabete

You can do just wget ā€¦ If youre not on a strict data plan

Everything about Lemmy; bugs, gripes, praises, and advocacy.

For discussion about the lemmy.ml instance, go to !meta@lemmy.ml.

  • 0 users online
  • 1 user / day
  • 11 users / week
  • 46 users / month
  • 212 users / 6 months
  • 4 subscribers
  • 377 Posts
  • 2.88K Comments
  • Modlog