install/uninstall/update/restart scripts
This commit is contained in:
13
install.sh
Normal file
13
install.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eux
|
||||
cd /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 >> /etc/cron.d/joeacnet
|
||||
@reboot /lib/joeac.net/restart.sh
|
||||
10 * * * * /lib/joeac.net/update_and_restart.sh
|
||||
EOF
|
||||
sudo systemctl restart crond.service
|
||||
|
||||
9
restart.sh
Normal file
9
restart.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eux
|
||||
|
||||
cd /lib/joeac.net
|
||||
podman-compose build
|
||||
podman-compose down
|
||||
podman-compose up -d
|
||||
|
||||
6
uninstall.sh
Normal file
6
uninstall.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
sudo rm /etc/cron.d/joeacnet
|
||||
sudo rm -rd /lib/joeac.net
|
||||
sudo systemctl restart crond.service
|
||||
|
||||
12
update_and_restart.sh
Normal file
12
update_and_restart.sh
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eux
|
||||
|
||||
cd /lib/joeac.net
|
||||
sudo git fetch origin main
|
||||
if [[ -z "$(git diff origin/main main)" ]]
|
||||
then
|
||||
sudo git pull
|
||||
./restart.sh
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user