This commit is contained in:
2026-05-11 13:13:29 +08:00
parent 4743038fed
commit c5089fbb9c
5 changed files with 57 additions and 6 deletions

21
install_to_systemd.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
echo "Installing Auto Fan..."
echo "Cleaning up old files..."
systemctl stop auto-fan
rm -rf /opt/Auto_Fan
rm -rf /etc/systemd/system/auto-fan.service
echo "Copying new files..."
mkdir -p /opt/Auto_Fan
cp -rf dist/fan /opt/Auto_Fan/
chmod +x /opt/Auto_Fan/fan
echo "Setting up systemd service..."
rm -rf /dev/shm/fan_status.json
cp -rf auto-fan.service /etc/systemd/system/
systemctl daemon-reload
systemctl enable auto-fan
systemctl start auto-fan
echo "Installation complete! Auto Fan is now running."