summaryrefslogtreecommitdiff
path: root/ar/.local/bin/arkenfox-auto-update
blob: 8e1ea7d604b208b96d8e8b140a2c76446d2e8186 (plain)
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
#!/bin/sh

# A wrapper for the arkenfox-updater that runs it on all pre-existing Arkenfox
# user.js files on the machine.

# On installation of LARBS, this file is copied to /usr/local/lib/ where it is
# run by a pacman hook set up. The user should not have to run this manually.

# Search for all Firefox and Librewolf profiles using Arkenfox.
profiles="$(grep -sH "arkenfox user.js" \
  /home/*/.librewolf/*.default/user.js \
  /home/*/.mozilla/firefox/*.default/user.js)"

IFS='
'

# Update each found profile.
for profile in $profiles; do
  userjs=${profile%%/user.js*}
  user=$(stat -c '%U' "$userjs") || continue

  su -l "$user" -c "arkenfox-updater -c -p $userjs -s"
done

# RTMIN: pkill
# PROJECT: pkill