Skip to content

Commit 04e6e77

Browse files
authored
v3.9 - fix #1670
1 parent bc5add9 commit 04e6e77

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

updater.sh

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,15 @@
22

33
## arkenfox user.js updater for macOS and Linux
44

5-
## version: 3.8
5+
## version: 3.9
66
## Author: Pat Johnson (@overdodactyl)
77
## Additional contributors: @earthlng, @ema-pe, @claustromaniac, @infinitewarp
88

99
## DON'T GO HIGHER THAN VERSION x.9 !! ( because of ASCII comparison in update_updater() )
1010

11-
# Check if running as root and if any files have the owner/group as root/wheel.
11+
# Check if running as root
1212
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
13+
printf "You shouldn't run this with elevated privileges (such as with doas/sudo).\n"
1914
exit 1
2015
fi
2116

@@ -396,6 +391,17 @@ show_banner
396391
update_updater "$@"
397392

398393
getProfilePath # updates PROFILE_PATH or exits on error
399-
cd "$PROFILE_PATH" && update_userjs
394+
cd "$PROFILE_PATH" || exit 1
395+
396+
# Check if any files have the owner/group as root/wheel.
397+
if [ -n "$(find ./ -user 0 -o -group 0)" ]; then
398+
printf 'It looks like this script was previously run with elevated privileges,
399+
you will need to change ownership of the following files to your user:\n'
400+
find . -user 0 -o -group 0
401+
cd "$CURRDIR"
402+
exit 1
403+
fi
404+
405+
update_userjs
400406

401407
cd "$CURRDIR"

0 commit comments

Comments
 (0)