-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall.sh
executable file
·95 lines (79 loc) · 2.3 KB
/
install.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/bin/bash
## Downloaded files save in /tmp
cd /tmp
## Colours
blue='\e[1;34m'
brown='\e[0;33m'
coloroff='\e[0m' # Colour off
cyan='\e[1;36m'
gray='\e[1;30m'
green='\e[0;32m'
purple='\e[1;35m'
red='\e[1;31m'
yellow='\e[1;33m'
## Download and run install script
install_phoenix() {
wget -nv $1
echo
echo
sudo bash $2
}
## Scripts are here
URL="https://phoenix.celenity.dev/installer_scripts"
## Scripts file
SCRIPT=("arch_install_paru.sh"
"arch_install_yay.sh"
"debian_install.sh"
"fedora_install.sh"
"macos_install.sh")
## Choose platform
echo -e "${purple}Welcome to the Phoenix installer!${coloroff}"
echo -e ""
echo -e "${yellow}To begin, please choose your platform (Its name or its number)${coloroff}"
echo -e "${yellow}Your options are:${coloroff}"
echo -e "${cyan}1. arch${coloroff} - ${green}Arch Linux (AUR)${coloroff}"
echo -e "${red}2. debian${coloroff} - ${green}Debian GNU/Linux & Derivatives (openSUSE Build System)${coloroff}"
echo -e "${blue}3. fedora${coloroff} - ${green}Fedora Linux (COPR)${coloroff}"
echo -e "${gray}4. macOS${coloroff} - ${green}macOS (Homebrew)${coloroff}"
echo -e "${brown}5. exit ${coloroff} - ${green}Exit from the Phoenix installer${coloroff}"
read -p 'Enter your selection: ' PLATFORM
case ${PLATFORM} in
"arch" | "Arch" | "ARCH" | 1)
echo -e ""
echo -e "${yellow}Please choose your AUR helper (Its name or its number)${coloroff}"
echo -e "${yellow}Your options are:${coloroff}"
echo -e "${blue}1. paru${coloroff} - ${green}Paru${coloroff}"
echo -e "${red}2. yay${coloroff} - ${green}Yay (Yet Another Yogurt)${coloroff}"
read -p 'Enter your selection: ' AUR_HELPER
case ${AUR_HELPER} in
"paru" | "Paru" | "PARU" | 1)
TARGET_SCRIPT="${SCRIPT[0]}"
;;
"yay" | "Yay" | "YAY" | 2)
TARGET_SCRIPT="${SCRIPT[1]}"
;;
*)
echo -e "${red}Invalid option.${coloroff}"
exit 1
;;
esac
;;
"debian" | "Debian" | "DEBIAN" | 2)
TARGET_SCRIPT="${SCRIPT[2]}"
;;
"fedora" | "Fedora" | "FEDORA" | 3)
TARGET_SCRIPT="${SCRIPT[3]}"
;;
"macOS" | "macos" | "MacOS" | "MACOS" | 4)
TARGET_SCRIPT="${SCRIPT[4]}"
;;
"exit" | "Exit" | "EXIT" | 5)
exit 0
;;
*)
echo -e "${red}Invalid option.${coloroff}"
exit 1
;;
esac
## Download and run choosen platform script
install_phoenix "${URL}"/"${TARGET_SCRIPT}" "${TARGET_SCRIPT}"