install/uninstall/update/restart scripts

This commit is contained in:
Joe Carstairs
2025-06-06 15:00:35 +01:00
committed by Joe Carstairs
parent 062195867a
commit 3addc0c952
4 changed files with 37 additions and 0 deletions

12
install.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/sh
set -eux
cd ${LIB_DIR:-/lib}
sudo git clone https://git.joeac.net/joeac/joeac.net.git
cd joeac.net
sudo chmod +x uninstall.sh update_and_restart.sh restart.sh
sudo echo << EOF >> ${CRONTABS_DIR:-/etc/cron.d}/joeacnet
@reboot ${LIB_DIR:-/lib}/joeac.net/restart.sh
10 * * * * ${LIB_DIR:-/lib}/joeac.net/update_and_restart.sh
EOF
sudo systemctl restart ${CRON_SERVICE:-crond.service}

8
restart.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/sh
set -eux
cd ${JOEACNET_DIR:-/lib/joeac.net}
podman-compose build
podman-compose down
podman-compose up -d

6
uninstall.sh Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/sh
set -eux
sudo rm ${CRONTABS_DIR:-/etc/cron.d}/joeacnet
sudo rm -rd ${LIB_DIR:-/lib}/joeac.net
sudo systemctl restart ${CRON_SERVICE:-crond.service}

11
update_and_restart.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/sh
set -eux
cd ${LIB_DIR:-/lib}/joeac.net
sudo git fetch origin main
if [[ -z "$(git diff origin/main main)" ]]
then
sudo git pull
./restart.sh
fi