]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
firefox-db2pem.sh: add macOS support, tidy-ups
authorViktor Szakats <commit@vsz.me>
Wed, 15 Oct 2025 17:46:35 +0000 (19:46 +0200)
committerViktor Szakats <commit@vsz.me>
Thu, 16 Oct 2025 18:53:28 +0000 (20:53 +0200)
Cherry-picked from #19076
Closes #19086

scripts/firefox-db2pem.sh

index c774ab9107c1185f5f420e6842dc13de1f8f6b25..634e429b504faedf5fe1c76bb25d614cf220e362 100755 (executable)
 
 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
@@ -55,7 +59,7 @@ certutil -L -h 'Builtin Object Token' -d "$db" | \
 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"