-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprereqs.sh
executable file
·68 lines (64 loc) · 2.48 KB
/
prereqs.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env bash
# Colors
Normal='\033[0m'
Red='\033[0;31m'
Green='\033[0;32m'
Yellow='\033[0;33m'
Blue='\033[0;34m'
Purple='\033[0;35m'
Cyan='\033[0;36m'
# Add fish repository and install latest for ubuntu
function install_ubuntu {
echo -e "${Cyan}===== INSTALLING FISH ====="
echo -e "${Purple}===== Adding PPA repository [sudo] =====${Normal}"
sudo apt-add-repository ppa:fish-shell/release-3 -y
echo -e "\n${Purple}Updating (apt update) =====${Normal}"
sudo apt update -y
echo -e "\n${Purple}===== Installing fish (apt install) =====${Normal}"
sudo apt install fish -y
echo -e "\n${Purple}===== Installing jq (apt install) =====${Normal}"
sudo apt install jq -y
if [ -n $(command -v fish) ]
then
echo -e "\n${Green}===== fish installed =====${Normal}\n"
else
echo -e "${Red}===== fish wasn't installed, try again =====\n"
fi
}
# Check out https://software.opensuse.org/download.html?project=shells%3Afish&package=fish for more info
# Add repo and install for debian 11 (bullseye)
function install_debian {
echo -e "${Cyan}===== INSTALLING FISH ====="
echo -e "${Purple}===== Adding repository [sudo] =====${Normal}"
echo 'deb http://download.opensuse.org/repositories/shells:/fish:/release:/3/Debian_11/ /' | sudo tee /etc/apt/sources.list.d/shells:fish.list
curl -fsSL https://download.opensuse.org/repositories/shells:/fish:/release:/3/Debian_11/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/shells_fish_release_3.gpg > /dev/null
echo -e "\n${Purple}Updating (apt update) =====${Normal}"
sudo apt update -y
echo -e "\n${Purple}===== Installing fish (apt install) =====${Normal}"
sudo apt install fish -y
echo -e "\n${Purple}===== Installing jq (apt install) =====${Normal}"
sudo apt install jq -y
if [ -n $(command -v fish) ]
then
echo -e "\n${Green}===== fish installed =====${Normal}\n"
else
echo -e "${Red}===== fish wasn't installed, try again =====\n"
fi
}
# Main
if [ $(uname) = 'Linux' ]
then
distro=$(grep "^ID=" /etc/os-release | sed -E 's/ID=(.*)/\1/')
echo -e "\n${Blue}Linux distro detected: ${Yellow}${distro}"
else
echo "No linux distro detected"
exit 0
fi
# Install fish for distro
case $distro in
ubuntu | pop) install_ubuntu ;;
debian ) install_debian ;;
fedora ) dnf install -y fish jq ;;
manjaro | arch ) pacman -S --noconfirm fish jq ;;
* ) echo -e "${Red}This installer doesn't support [${distro}]${Normal}" ;;
esac