-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.sh
48 lines (39 loc) · 1.29 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
44
45
46
47
48
#!/bin/bash
export LC_ALL=en_US.UTF-8
# Firefox user.js by Denis G.
# https://github.com/denis-g/firefox-user.js
# config
source ./config.ini
if [ -z "$FIREFOX_PROFILE" ]; then
echo "Error: Variable FIREFOX_PROFILE is empty or wrong"
echo "Please check FIREFOX_PROFILE variable on config.ini file"
exit 22
fi
if [ ! -d "$FIREFOX_PROFILE" ]; then
echo "Error: Firefox profile directory does not exists"
echo "Please check FIREFOX_PROFILE variable on config.ini file"
exit 2
fi
# cleaner
rm -rf "${FIREFOX_PROFILE}/chrome/"
if curl -s -L "https://raw.githubusercontent.com/arkenfox/user.js/master/updater.sh" -o "${FIREFOX_PROFILE}/updater.sh"; then
# generate user.js
cp ./user-overrides.js "${FIREFOX_PROFILE}/user-overrides.js"
sh "${FIREFOX_PROFILE}/updater.sh" -d -s
# copy styles
cp -R ./chrome/ "${FIREFOX_PROFILE}/chrome/"
if curl -s -L "https://raw.githubusercontent.com/arkenfox/user.js/master/prefsCleaner.sh" -o "${FIREFOX_PROFILE}/prefsCleaner.sh"; then
# clean prefs.js
sh "${FIREFOX_PROFILE}/prefsCleaner.sh" -d -s
else
echo "Error! Could not download arkenfox/user.js"
exit 2
fi
# remove user-overrides.js
rm -rf "${FIREFOX_PROFILE}/user-overrides.js"
echo "Completed!"
exit 0
else
echo "Error! Could not download arkenfox/user.js"
exit 2
fi