Update 2025-04-13_16:14:16
This commit is contained in:
31
update_fancontrol.sh
Executable file
31
update_fancontrol.sh
Executable file
@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Pfad zur aktuellen fancontrol Konfiguration und den Alternativen
|
||||
CURRENT_CONFIG="/etc/fancontrol"
|
||||
CONFIG_HWMON1="/etc/fancontrol.hwmon1"
|
||||
CONFIG_HWMON2="/etc/fancontrol.hwmon2"
|
||||
|
||||
# Überprüfen und Kopieren der entsprechenden Konfigurationsdatei
|
||||
update_config() {
|
||||
for i in 1 2; do
|
||||
if [ -L "/sys/class/hwmon/hwmon$i" ]; then
|
||||
# Ziel des Symlinks auslesen
|
||||
link_target=$(readlink -f "/sys/class/hwmon/hwmon$i")
|
||||
# Überprüfen, ob der Symlink auf das erwartete Ziel zeigt
|
||||
if [[ "$link_target" == *"/devices/pci0000:00/0000:00:18.3/hwmon/hwmon$i"* ]]; then
|
||||
# Entsprechende Konfigurationsdatei kopieren
|
||||
echo "Kopiere /etc/fancontrol.hwmon$i nach /etc/fancontrol..."
|
||||
cp "/etc/fancontrol.hwmon$i" "$CURRENT_CONFIG"
|
||||
# fancontrol Dienst neu starten
|
||||
systemctl restart fancontrol
|
||||
echo "fancontrol Dienst wurde neu gestartet."
|
||||
return
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Keine passende hwmon Konfiguration gefunden."
|
||||
}
|
||||
|
||||
# Konfigurationsupdate-Funktion aufrufen
|
||||
update_config
|
Reference in New Issue
Block a user