mirror of
https://github.com/Pakobbix/passive-income.git
synced 2025-11-09 14:59:40 +00:00
added an lock file to exit restarter if restart is already triggered
If you want multiple conditions (if ping is sucessfull, on less than X CPU Usage etc) for the restarter, it will create a lock file now to avoid multiple instances.
This commit is contained in:
parent
f9e234915d
commit
c9faefa42c
@ -7,6 +7,14 @@ containername=ebesucher
|
|||||||
# Variable für die Maximale Nutzung von CPU Cores
|
# Variable für die Maximale Nutzung von CPU Cores
|
||||||
CPUcores=
|
CPUcores=
|
||||||
|
|
||||||
|
# Überprüfe ob bereits ein restart läuft
|
||||||
|
if [ -f /tmp/ebesucher_restart.lock ]; then
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Erstelle Lockfile
|
||||||
|
echo $$ > ebesucher_restart.lock
|
||||||
|
|
||||||
# Ordner des Skripts
|
# Ordner des Skripts
|
||||||
git_dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
git_dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
||||||
# Wechsel in den Ordner
|
# Wechsel in den Ordner
|
||||||
@ -41,3 +49,4 @@ elif [[ $ram_avail -ge "5" ]]; then
|
|||||||
docker_run "4g" "$CPUSet"
|
docker_run "4g" "$CPUSet"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
rm -f /tmp/ebesucher_restart.lock
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user