melhorando o script

This commit is contained in:
gmdutra 2017-11-14 10:54:05 -02:00
parent 29fff40b39
commit b21b8e9669

View File

@ -1,14 +1,21 @@
#!/bin/bash
function vefificaRoot(){
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
}
sudo apt install build-essential bc git wget
function installDep(){
for dep in build-essential bc git wget; do
sudo apt install $dep
done
}
function configure(){
cd /usr/src
git clone --depth 1 https://github.com/raspberrypi/linux.git
ln -s linux $(uname -r)
@ -49,3 +56,8 @@ while true; do
* ) echo "Please answer yes or no.";;
esac
done
}
verificaRoot
installDep
configure