-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sos-firefoxstig.sh
40 lines (31 loc) · 941 Bytes
/
sos-firefoxstig.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
#!/bin/bash
# Function to display messages in red and exit
die() {
echo -e "\033[91m$1\033[0m" >&2
exit 1
}
# Testing if root...
testRoot() {
if [ $UID -ne 0 ] ; then
die "You must run this script as root"
fi
}
# Check if config_dir exists
checkInstall() {
if [ ! -d "$config_dir" ]; then
die "The specified Firefox directory does not exist. Firefox may not be installed or not in the default directory."
fi
}
testRoot
# For linux
config_dir="/lib/firefox/"
preferences_dir="/lib/firefox/browser/defaults/preferences/"
checkInstall
distribution_dir="/lib/firefox/distribution/"
mkdir -p "$distribution_dir"
#cp ./Files/Config/distribution/policies.json "$distribution_dir"
# Create directories if they don't exist
mkdir -p "$preferences_dir"
# Copy files to the directories
cp ./Files/Config/mozilla.cfg "$config_dir"
cp -r ./Files/Config/browser/defaults/preferences/* "$preferences_dir"