mint-config-update.sh aktualisiert

This commit is contained in:
olli 2023-11-23 13:29:06 +01:00
parent c9801c1326
commit cba64086dc

View File

@ -1,30 +1,31 @@
#!/bin/bash #!/bin/bash
if whoami | grep -q ^root$ if whoami | grep -q ^root$
then then
# lockfile for systemd-service # lockfile for systemd-service
trap "rm -f /run/mint-config-update.sh.lock" EXIT trap "rm -f /run/mint-config-update.sh.lock" EXIT
echo $$ >/run/mint-config-update.sh.lock echo $$ >/run/mint-config-update.sh.lock
#if find /var/log/mint-config-update.sh.log -mmin -60 | grep -q /var/log/mint-config-update.sh.log #if find /var/log/mint-config-update.sh.log -mmin -60 | grep -q /var/log/mint-config-update.sh.log
#then #then
# echo "$0 was running already in the last 60 minutes" # echo "$0 was running already in the last 60 minutes"
# rm -f /run/mint-config-update.sh.lock # rm -f /run/mint-config-update.sh.lock
# sleep 60 # sleep 60
# exit 0 # exit 0
#fi #fi
fi fi
# download and run # download and run
until wget https://gitea.ds9.dedyn.io/olli/linux-mint/raw/branch/main/mint.sh -O /tmp/mint.sh until wget https://gitea.ds9.dedyn.io/olli/linux-mint/raw/branch/main/mint.sh -O /tmp/mint.sh
do do
echo "mint.sh could not be downloaded trying again in 5 seconds" echo "mint.sh could not be downloaded trying again in 5 seconds"
sleep 5 sleep 5
done done
cd /tmp cd /tmp
bash -n mint.sh && bash mint.sh dos2unix mint.sh
rm mint.sh bash -n mint.sh && bash mint.sh
rm mint.sh
echo "Skript beendet"
whoami | grep -q ^root$ && exit 0 echo "Skript beendet"
read x whoami | grep -q ^root$ && exit 0
read x