-
Notifications
You must be signed in to change notification settings - Fork 2
/
update-config.sh
37 lines (35 loc) · 1.31 KB
/
update-config.sh
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
#!/bin/bash
if [ -f "gpu-fancurve.conf" ]
then
echo "Copying ./gpu-fancurve.conf to $HOME/.config/gpu-fancurve.conf..."
cp ./gpu-fancurve.conf $HOME/.config/
else
if [ -f "gpu-fancurve.conf.example" ]
then
while true; do
read -p "Couldn't find gpu-fancurve.conf. Use example configuration? (YES/no) " prompt
if [ "${prompt,,}" == "yes" ] || [ "${prompt,,}" == "y" ] || [ "${prompt,,}" == "" ]
then
echo "Copying gpu-fancurve.conf.example to $HOME/.config/gpu-fancurve.conf..."
cp gpu-fancurve.conf.example $HOME/.config/gpu-fancurve.conf
break
elif [ "${prompt,,}" == "no" ] || [ "${prompt,,}" == "n" ]
then
echo "Cancelling update, no changes have been made to the system."
exit
fi
echo "Sorry, I didn't understand that. Please type yes or no"
done
else
echo "Couldn't find ./gpu-fancurve.conf or ./gpu-fancurve.conf.example. No changes have been made to the system."
exit
fi
fi
if ! [ -f "$HOME/.config/gpu-fancurve.conf" ]
then
echo "Couldn't create $HOME/.config/gpu-fancurve.conf. Please create the file manually using the example file as a guide."
fi
echo "Killing and restarting gpu-fancurve..."
pkill gpu-fancurve
(gpu-fancurve >/dev/null 2>&1) &
echo "Done!"