可传参

This commit is contained in:
2026-05-11 00:22:18 +08:00
parent 9f785a17f5
commit 4743038fed
3 changed files with 32 additions and 7 deletions

View File

@@ -1,13 +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
cp -rf auto-fan.service /etc/systemd/system/
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
systemctl start auto-fan
echo "Installation complete! Auto Fan is now running."