From c02eb726811bb806cd586e79d657f8e664141654 Mon Sep 17 00:00:00 2001 From: klea Date: Sun, 4 Jan 2026 23:13:57 +0000 Subject: bin(wpox): script to handle starting warcprox I should later add options from some array so users can change config --- bin/wpox | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 bin/wpox (limited to 'bin') diff --git a/bin/wpox b/bin/wpox new file mode 100755 index 0000000..5e59c31 --- /dev/null +++ b/bin/wpox @@ -0,0 +1,22 @@ +#!/bin/bash +WPOXCFG="${1:-${XDG_CONFIG_HOME:-$HOME/.config}/wpox.sh}" +[ -f "$WPOXCFG" ] && source "$WPOXCFG" +[ "$#" -gt 0 ] && shift; +: "${WPOX_DIR:=$HOME/WPOX}" + +errex() { + echo "$@" >&2 + exit 1 +} + +[ -d "$WPOX_DIR" ] || errex "Please create $WPOX_DIR to proceed" +cd "$WPOX_DIR" || errex "Cannot change to $WPOX_DIR" +[ -d "$WPOX_DIR/ca" ] || mkdir "$WPOX_DIR/ca" + +warcprox \ + --cacert "$WPOX_DIR/ca.pem" \ + --certs-dir "$WPOX_DIR/ca" \ + --stats-db-file "$WPOX_DIR/warcprox.sqlite" \ + --dedup-db-file "$WPOX_DIR/warcprox.sqlite" \ + --gzip \ + "$@" -- cgit v1.3.1-10-gc9f91