Skip to content

Commit da06621

Browse files
committed
firefox-db2pem.sh: add macOS support, tidy-ups
Cherry-picked from curl#19076 Closes curl#19086
1 parent c8aaa5d commit da06621

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

scripts/firefox-db2pem.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@
3232

3333
set -eu
3434

35-
db=$(ls -1d "$HOME"/.mozilla/firefox/*default*)
35+
if [ -d "$HOME/Library/Application Support"/Firefox/Profiles ]; then
36+
db=$(ls -1d "$HOME/Library/Application Support"/Firefox/Profiles/*default*)
37+
else
38+
db=$(ls -1d "$HOME"/.mozilla/firefox/*default*)
39+
fi
3640
out="${1:-}"
3741

3842
if test -z "$out"; then
@@ -55,7 +59,7 @@ certutil -L -h 'Builtin Object Token' -d "$db" | \
5559
grep ' *[CcGTPpu]*,[CcGTPpu]*,[CcGTPpu]* *$' | \
5660
sed -e 's/ *[CcGTPpu]*,[CcGTPpu]*,[CcGTPpu]* *$//' -e 's/\(.*\)/"\1"/' | \
5761
sort | \
58-
while read -r nickname; \
59-
do echo "$nickname" | sed -e "s/Builtin Object Token://g"; \
60-
echo "$nickname" | xargs -I{} certutil -d "$db" -L -a -n -- {} ; \
62+
while read -r nickname; do
63+
echo "$nickname" | sed 's/Builtin Object Token://g'
64+
echo "$nickname" | xargs -I{} certutil -d "$db" -L -a -n {}
6165
done >> "$out"

0 commit comments

Comments
 (0)