linux-mint/mint-config-update.sh

31 lines
726 B
Bash
Raw Normal View History

2022-07-22 11:05:23 +02:00
#!/bin/bash
2023-07-18 15:09:21 +02:00
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
2023-08-09 18:53:43 +02:00
if find /var/log/mint-config-update.sh.log -mmin +60 | grep -q /var/log/mint-config-update.sh.log
2023-08-09 18:46:26 +02:00
then
echo "$0 was running already in the last 60 minutes"
rm -f /run/mint-config-update.sh.lock
sleep 60
2023-08-09 18:53:43 +02:00
exit 0
2023-08-09 18:46:26 +02:00
fi
2023-07-18 15:09:21 +02:00
fi
2023-07-18 13:57:09 +02:00
# download and run
2023-08-09 17:31:59 +02:00
until wget https://gitea.ds9.dedyn.io/olli/linux-mint/raw/branch/main/mint.sh -O /tmp/mint.sh
2023-08-09 17:23:41 +02:00
do
echo "mint.sh could not be downloaded trying again in 5 seconds"
sleep 5
done
2022-07-22 09:59:24 +02:00
cd /tmp
2023-07-26 13:54:24 +02:00
bash -n mint.sh && bash mint.sh
2022-07-22 11:05:43 +02:00
rm mint.sh
2022-07-22 10:40:51 +02:00
echo "Skript beendet"
2023-07-18 15:09:57 +02:00
whoami | grep -q ^root$ && exit 0
2022-07-22 10:40:51 +02:00
read x