quiethost

This commit is contained in:
Lucas Faber authored and Lucas Vivohost committed 2026-09-14 09:20:47 +02:00
1 parent 9c379af76b
commit b3c06c0a80
47 files changed
+2116

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
#nmcli con down id VPN1
LOGFILE=/home/lucas/.LOG/deluged-log.log
exec >>$LOGFILE 2>&1
if [ "$(pgrep deluge)" != "" ]; then
date
VPN="$(nmcli con show --active | grep -i vpn) "
ret=$?
echo "${VPN}Status: $ret" | sed 's/ */ /g'
if [ $ret -ne 0 ]; then
echo "No VPN active. Starting VPN"
nmcli con up id VPN1
sleep 1
VPN="$(nmcli con show --active | grep vpn)"
ret=$?
echo "STATUS:$ret $VPN"
if [ $ret -ne 0 ]; then
echo "Starting VPN failed. Start killing all Deluge processes"
pkill deluged
pkill deluge-gtk
echo "Kill VPN and Restart network"
nmcli radio all off
nmcli radio all on
fi
else
echo "All in Order. Proceed as usual."
fi
fi
filesize=$(stat -c%s $LOGFILE)
if [ $filesize -gt 1000000 ]; then
line=$(( $(cat $LOGFILE | wc -l)/2 ))
echo "Filesize: $filesize: Delete Line 1 - $line"
sed -i "1,${line}d" $LOGFILE
fi