|
2 | 2 |
|
3 | 3 | ## prefs.js cleaner for Linux/Mac |
4 | 4 | ## author: @claustromaniac |
5 | | -## version: 1.9 |
| 5 | +## version: 2.0 |
6 | 6 |
|
7 | 7 | ## special thanks to @overdodactyl and @earthlng for a few snippets that I stol..*cough* borrowed from the updater.sh |
8 | 8 |
|
9 | 9 | ## DON'T GO HIGHER THAN VERSION x.9 !! ( because of ASCII comparison in update_prefsCleaner() ) |
10 | 10 |
|
11 | | -# Check if running as root and if any files have the owner/group as root/wheel. |
12 | | -if [ "${EUID:-"$(id -u)"}" -eq 0 ]; then |
13 | | - printf "You shouldn't run this with elevated privileges (such as with doas/sudo).\n" |
14 | | - exit 1 |
15 | | -elif [ -n "$(find ./ -user 0 -o -group 0)" ]; then |
16 | | - printf 'It looks like this script was previously run with elevated privileges, |
17 | | -you will need to change ownership of the following files to your user:\n' |
18 | | - find . -user 0 -o -group 0 |
19 | | - exit 1 |
20 | | -fi |
21 | | - |
22 | 11 | readonly CURRDIR=$(pwd) |
23 | 12 |
|
24 | 13 | ## get the full path of this script (readlink for Linux, greadlink for Mac with coreutils installed) |
@@ -143,13 +132,23 @@ done |
143 | 132 | ## change directory to the Firefox profile directory |
144 | 133 | cd "$(dirname "${SCRIPT_FILE}")" |
145 | 134 |
|
| 135 | +# Check if running as root and if any files have the owner/group as root/wheel. |
| 136 | +if [ "${EUID:-"$(id -u)"}" -eq 0 ]; then |
| 137 | + fQuit 1 "You shouldn't run this with elevated privileges (such as with doas/sudo)." |
| 138 | +elif [ -n "$(find ./ -user 0 -o -group 0)" ]; then |
| 139 | + printf 'It looks like this script was previously run with elevated privileges, |
| 140 | +you will need to change ownership of the following files to your user:\n' |
| 141 | + find . -user 0 -o -group 0 |
| 142 | + fQuit 1 |
| 143 | +fi |
| 144 | + |
146 | 145 | [ "$AUTOUPDATE" = true ] && update_prefsCleaner "$@" |
147 | 146 |
|
148 | 147 | echo -e "\n\n" |
149 | 148 | echo " ╔══════════════════════════╗" |
150 | 149 | echo " ║ prefs.js cleaner ║" |
151 | 150 | echo " ║ by claustromaniac ║" |
152 | | -echo " ║ v1.9 ║" |
| 151 | +echo " ║ v2.0 ║" |
153 | 152 | echo " ╚══════════════════════════╝" |
154 | 153 | echo -e "\nThis script should be run from your Firefox profile directory.\n" |
155 | 154 | echo "It will remove any entries from prefs.js that also exist in user.js." |
|
0 commit comments