set -eu
-db=$(ls -1d "$HOME"/.mozilla/firefox/*default*)
+if [ -d "$HOME/Library/Application Support"/Firefox/Profiles ]; then
+ db=$(ls -1d "$HOME/Library/Application Support"/Firefox/Profiles/*default*)
+else
+ db=$(ls -1d "$HOME"/.mozilla/firefox/*default*)
+fi
out="${1:-}"
if test -z "$out"; then
grep ' *[CcGTPpu]*,[CcGTPpu]*,[CcGTPpu]* *$' | \
sed -e 's/ *[CcGTPpu]*,[CcGTPpu]*,[CcGTPpu]* *$//' -e 's/\(.*\)/"\1"/' | \
sort | \
-while read -r nickname; \
- do echo "$nickname" | sed -e "s/Builtin Object Token://g"; \
- echo "$nickname" | xargs -I{} certutil -d "$db" -L -a -n -- {} ; \
+while read -r nickname; do
+ echo "$nickname" | sed 's/Builtin Object Token://g'
+ echo "$nickname" | xargs -I{} certutil -d "$db" -L -a -n {}
done >> "$out"