about summary refs log tree commit diff stats
path: root/hm/soispha/conf/firefox/scripts/extract_cookies.sh
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2024-02-20 17:21:42 +0100
committerSoispha <soispha@vhack.eu>2024-02-20 17:21:42 +0100
commitf2bdeaed0bcf97a880fe36cfc8a050d1643120b8 (patch)
treeba4fe9c3ddf076529701c0e776ffef2104ac23d5 /hm/soispha/conf/firefox/scripts/extract_cookies.sh
parentrefactor(treewide): Add a `.sh` extension to shell scripts (diff)
downloadnixos-config-f2bdeaed0bcf97a880fe36cfc8a050d1643120b8.zip
refactor(treewide): Reformat all files with treefmt
This includes getting all shellscripts to pass shellcheck. To accomplish
this, some old scripts were removed
Diffstat (limited to 'hm/soispha/conf/firefox/scripts/extract_cookies.sh')
-rwxr-xr-xhm/soispha/conf/firefox/scripts/extract_cookies.sh11
1 files changed, 3 insertions, 8 deletions
diff --git a/hm/soispha/conf/firefox/scripts/extract_cookies.sh b/hm/soispha/conf/firefox/scripts/extract_cookies.sh
index e4eec72c..e3d50d43 100755
--- a/hm/soispha/conf/firefox/scripts/extract_cookies.sh
+++ b/hm/soispha/conf/firefox/scripts/extract_cookies.sh
@@ -10,7 +10,6 @@
 # which means cookies which are kept only in memory ("session cookies")
 # will not be extracted. You will need an extension to do that.
 
-
 # USAGE:
 #
 # $ extract_cookies.sh > /tmp/cookies.txt
@@ -31,20 +30,17 @@
 #
 # B) If you've redirected stdin (with < or |) , then that will be used.
 
-
 # HISTORY: I believe this is circa 2010 from:
 # http://slacy.com/blog/2010/02/using-cookies-sqlite-in-wget-or-curl/
 # However, that site is down now.
 
 # Cleaned up by Hackerb9 (2017) to be more robust and require less typing.
 
-
 cleanup() {
     rm -f "$TMPFILE"
     exit 0
 }
-trap cleanup  EXIT INT QUIT TERM
-
+trap cleanup EXIT INT QUIT TERM
 
 if [ "$#" -ge 1 ]; then
     SQLFILE="$1"
@@ -59,14 +55,13 @@ fi
 
 # We have to copy cookies.sqlite, because FireFox has a lock on it
 TMPFILE=$(mktemp /tmp/cookies.sqlite.XXXXXXXXXX)
-cat "$SQLFILE" >> "$TMPFILE"
-
+cat "$SQLFILE" >>"$TMPFILE"
 
 # This is the format of the sqlite database:
 # CREATE TABLE moz_cookies (id INTEGER PRIMARY KEY, name TEXT, value TEXT, host TEXT, path TEXT,expiry INTEGER, lastAccessed INTEGER, isSecure INTEGER, isHttpOnly INTEGER);
 
 echo "# Netscape HTTP Cookie File"
-sqlite3 -separator $'\t' "$TMPFILE" << EOF
+sqlite3 -separator $'\t' "$TMPFILE" <<EOF
 .mode tabs
 .header off
 select host,