auto update added nginx, codeserver

Fix bug when using symbolic link
replace logger
This commit is contained in:
2024-05-27 02:20:19 +01:00
parent b303c05e3f
commit 600d3845f0
3 changed files with 25 additions and 2 deletions

View File

@@ -0,0 +1,9 @@
#! /bin/bash
scriptPath="$(dirname "$(readlink -f "$0")")"
currentPath=$PWD
cd $scriptPath
docker-compose pull
docker-compose up --force-recreate --build -d
cd $currentPath

9
docker/nginx/docker-run.sh Executable file
View File

@@ -0,0 +1,9 @@
#! /bin/bash
scriptPath="$(dirname "$(readlink -f "$0")")"
currentPath=$PWD
cd $scriptPath
docker-compose pull
docker-compose up --force-recreate --build -d
cd $currentPath

View File

@@ -1,14 +1,19 @@
#!/bin/bash
scriptPath=$(dirname "$0")
#scriptPath=$(dirname "$0") not working if called from symbolic link
scriptPath="$(dirname "$(readlink -f "$0")")"
doWork(){
apt update -y
apt dist-upgrade -y
$scriptPath/../docker/portainer/docker-run.sh
$scriptPath/../docker/promtail/docker-run.sh
$scriptPath/../docker/telegraf/docker-run.sh
$scriptPath/../docker/code-server/docker-run.sh
$scriptPath/../docker/nginx/docker-run.sh
docker image prune -f
}
doWork 2>&1 | systemd-cat -t "auto-update"
doWork 2>&1 | logger -s -t "auto-update"
#doWork 2>&1 | logger -t "auto-update"
#example to check logs for autou-pdate
#journalctl --since yesterday -u cron.service | grep auto-update
exit 0