From cba64086dcef0307a3df9985823e62d97b3f8952 Mon Sep 17 00:00:00 2001 From: olli Date: Thu, 23 Nov 2023 13:29:06 +0100 Subject: [PATCH] mint-config-update.sh aktualisiert --- mint-config-update.sh | 61 ++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/mint-config-update.sh b/mint-config-update.sh index 8ba9418..42c3665 100644 --- a/mint-config-update.sh +++ b/mint-config-update.sh @@ -1,30 +1,31 @@ -#!/bin/bash - -if whoami | grep -q ^root$ -then - # lockfile for systemd-service - trap "rm -f /run/mint-config-update.sh.lock" EXIT - 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 - #then - # echo "$0 was running already in the last 60 minutes" - # rm -f /run/mint-config-update.sh.lock - # sleep 60 - # exit 0 - #fi -fi - -# download and run -until wget https://gitea.ds9.dedyn.io/olli/linux-mint/raw/branch/main/mint.sh -O /tmp/mint.sh -do - echo "mint.sh could not be downloaded trying again in 5 seconds" - sleep 5 -done - -cd /tmp -bash -n mint.sh && bash mint.sh -rm mint.sh - -echo "Skript beendet" -whoami | grep -q ^root$ && exit 0 -read x +#!/bin/bash + +if whoami | grep -q ^root$ +then + # lockfile for systemd-service + trap "rm -f /run/mint-config-update.sh.lock" EXIT + 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 + #then + # echo "$0 was running already in the last 60 minutes" + # rm -f /run/mint-config-update.sh.lock + # sleep 60 + # exit 0 + #fi +fi + +# download and run +until wget https://gitea.ds9.dedyn.io/olli/linux-mint/raw/branch/main/mint.sh -O /tmp/mint.sh +do + echo "mint.sh could not be downloaded trying again in 5 seconds" + sleep 5 +done + +cd /tmp +dos2unix mint.sh +bash -n mint.sh && bash mint.sh +rm mint.sh + +echo "Skript beendet" +whoami | grep -q ^root$ && exit 0 +read x