-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fedora_install.sh
executable file
·96 lines (65 loc) · 2.31 KB
/
fedora_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
96
#! /usr/bin/env bash
cd /tmp
echo_red_text() {
echo -e "\033[31m$1\033[0m"
}
echo_green_text() {
echo -e "\033[32m$1\033[0m"
}
error_fn() {
echo
echo -e "\033[31mSomething went wrong! The script failed.\033[0m"
exit 1
}
if [ $(id --user) -ne 0 ]; then
echo_red_text "You must run this script with sudo"
exit 1
fi
### Start of checking version ###
Local_Fedora_Version=$(grep 'VERSION_ID=' /etc/os-release | cut -d'=' -f2)
Supported_Versions=(39 40 41)
check_version() {
for i in ${Supported_Versions[@]}
do
if [[ ${i} -eq ${Local_Fedora_Version} ]]; then
export result=0
break
else
export result=1
fi
done
}
check_version
if [[ ${result} -eq 1 ]]; then
echo_red_text "Sorry! Your Fedora version is not supported!"
exit 1
fi
### End of checking version ###
echo_green_text "Downloading mozilla.cfg"
wget -nv https://phoenix.celenity.dev/mozilla.cfg || error_fn
echo
echo_green_text "Moving mozilla.cfg to /usr/lib64/firefox/mozilla.cfg"
sudo mv -v mozilla.cfg /usr/lib64/firefox/mozilla.cfg || error_fn
echo
echo_green_text "Downloading local-settings.js"
wget -nv https://phoenix.celenity.dev/defaults/pref/local-settings.js || error_fn
echo
echo_green_text "Creating /usr/lib64/firefox/defaults/pref directory"
sudo mkdir -v -p /usr/lib64/firefox/defaults/pref || error_fn
echo
echo_green_text "Changing permissions of /usr/lib64/firefox/defaults/pref to 755"
sudo chmod -v 755 /usr/lib64/firefox/defaults/pref || error_fn
echo
echo_green_text "Moving local-settings.js to /usr/lib64/firefox/defaults/pref/local-settings.js"
sudo mv -v local-settings.js /usr/lib64/firefox/defaults/pref/local-settings.js || error_fn
echo
echo_green_text "Adding Phoenix-Policies COPR Repo to DNF"
sudo dnf copr enable celenity/phoenix-policies || error_fn
echo
echo_green_text "Updating DNF cache"
sudo dnf update --refresh || error_fn
echo
echo_green_text "Installing phoenix-policies package"
sudo dnf install phoenix-policies || error_fn
echo
echo_green_text "All done. :) Congratulations, you've successfully installed Phoenix.\nWhat comes next is for you to decide. I would strongly recommend taking a look at some of the user.js files we offer, such as our 'Hardened' option for more comprehensive protection, at the cost of minimal breakage.\nYou can learn more here https://phoenix.celenity.dev/#complete-coverage.\n"