Files
battery/setup.sh
2022-01-28 10:07:23 +01:00

33 lines
839 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# Get smc source and build it
tempfolder=tmp
binfolder=/usr/local/bin
echo -e "\nCloning fan control version of smc"
git clone -depth 1 https://github.com/hholtmann/smcFanControl.git $tempfolder
cd $tempfolder/smc-command
echo -e "\nMaking smc from source"
make &> /dev/null
# Move built file to bin folder
echo -e "\nMove smc to executable folder"
sudo mkdir -p $binfolder
sudo mv ./smc $binfolder
sudo chmod u+x $binfolder/smc
# Remove tempfiles
cd ../..
echo -e "\nRemoving temp folder $(pwd)/$tempfolder"
rm -rf $tempfolder
echo -e "\nSmc binary built"
# Write battery function as executable
echo "Writing script to $binfolder/battery"
sudo cp battery.sh $binfolder/battery
sudo chmod 755 $binfolder/battery
sudo chmod u+x $binfolder/battery
echo -e "\nBattery tool installed. Type \"battery\" for instructions."