summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorappeasementPolitik <108810900+appeasementPolitik@users.noreply.github.com>2023-08-18 12:20:05 +0000
committerGitHub <noreply@github.com>2023-08-18 12:20:05 +0000
commitf26e5678e626e604ed586fc6420b944dc023d3f2 (patch)
treed40bf5f53c53372d5454197f0a409c85d153519f
parented9633da3f876b6c9dae13434fb7ea30208a5b5f (diff)
downloadeibhear-f26e5678e626e604ed586fc6420b944dc023d3f2.tar.gz
eibhear-f26e5678e626e604ed586fc6420b944dc023d3f2.tar.zst
eibhear-f26e5678e626e604ed586fc6420b944dc023d3f2.zip
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.
-rwxr-xr-x.local/bin/arkenfox-auto-update5
1 files changed, 4 insertions, 1 deletions
diff --git a/.local/bin/arkenfox-auto-update b/.local/bin/arkenfox-auto-update
index 05f4ca7..7664a4f 100755
--- a/.local/bin/arkenfox-auto-update
+++ b/.local/bin/arkenfox-auto-update
@@ -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