-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.sh
executable file
·43 lines (40 loc) · 1.08 KB
/
setup.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
38
39
40
41
42
43
#!/bin/bash
sox="sox"
libsox="libsox-fmt-all"
function systemBasicUpdates()
{
# Update the apt package index and Upgrade the Ubuntu system
sudo apt-get update
if [[ $? > 0 ]]
then
echo "apt-get update failed, exiting."
exit
else
echo "apt-get update ran succesfuly, continuing with script."
fi
sudo apt-get -y upgrade
if [[ $? > 0 ]]
then
echo "apt-get upgrade failed, exiting."
exit
else
echo "apt-get upgrade ran succesfuly, continuing with script."
fi
}
function installAptPackages()
{
for pkg in $1; do
if dpkg --get-selections | grep -q "^$pkg[[:space:]]*install$" >/dev/null; then
echo -e "$pkg is already installed"
else
if sudo apt-get -qq install $pkg; then
echo "Successfully installed $pkg"
else
echo "Error installing $pkg"
fi
fi
done
}
#MainStartsHere
installAptPackages ${sox}
installAptPackages ${libsox}