Fix arkenfox pacman hook complaining about root (#1351)

The previous pull request on LARBS turned out not to work, so make sure `arkenfox-auto-update` runs `arkenfox-update` as the user of the firefox profile. Otherwise it complains that it's running as root and stops.

The way of getting the username is safe, because it gets the username from the owner of the user.js file of that profile.
This commit is contained in:
appeasementPolitik 2023-08-18 12:20:05 +00:00 committed by GitHub
parent ed9633da3f
commit f26e5678e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,5 +16,8 @@ IFS='
# Update each found profile.
for profile in $profiles; do
arkenfox-updater -p "${profile%%/user.js*}" -s
userjs=${profile%%/user.js*}
user=$(stat -c '%U' "$userjs") || continue
su -l "$user" -c "arkenfox-updater -c -p $userjs -s"
done