-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·45 lines (35 loc) · 1.05 KB
/
install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root."
exit
fi
#set -e
if ! command -v nvidia-smi &> /dev/null
then
echo "Error: command `nvidia-smi` not found. Please install the nVidia driver manually."
exit
fi
if ! command -v sensors &> /dev/null
then
echo "Error: command `sensors` not found. Installing lm-sensors..."
apt-get install lm-sensors
fi
if ! command -v nvidia-smi &> /dev/null
then
echo "Error: command `i8kctl` not found. Installing i8kutils..."
apt-get install i8kutils
fi
cp xpsfan.conf /etc/xpsfan.conf
chmod 644 /etc/xpsfan.conf
chown root:root /etc/xpsfan.conf
cp xpsfan /usr/local/bin/xpsfan
chmod 744 /usr/local/bin/xpsfan
chown root:root /usr/local/bin/xpsfan
cp xpsfan.service /etc/systemd/system/xpsfan.service
chmod 644 /etc/systemd/system/xpsfan.service
echo "options dell-smm-hwmon restricted=0 force=1" > /etc/modprobe.d/xpsfan.conf
echo "dell-smm-hwmon" > /etc/modules-load.d/xpsfan.conf
modprobe dell-smm-hwmon restricted=0 force=1
systemctl enable xpsfan
service xpsfan restart
echo "Done"