truckstop/testdata/scrape_cookies.sh

21 lines
475 B
Bash

#! /bin/bash
main() {
set -e
set -o pipefail
local profile_root="/Users/breel/Library/Application Support/Firefox/Profiles/nk8e5y5u.ronnie"
local cookie_original="${profile_root%/}/cookies.sqlite"
f=$(mktemp)
cleanup() ( rm -f "$f"; )
trap cleanup EXIT
cp "$cookie_original" "$f"
echo 'select name, value, expiry from moz_cookies where host like "%ntgvision%";' | sqlite3 "$f"
echo f=$f
}
if [ "$0" == "$BASH_SOURCE" ]; then
main "$@"
fi