summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorGravatar klea2026-01-04 23:13:57 +0000
committerGravatar klea2026-01-04 23:13:57 +0000
commitc02eb726811bb806cd586e79d657f8e664141654 (patch)
treea5d32728e9f72d68c378ce50624d08f8d772cbf7 /bin
parentpkgs(shell): add warcprox to the shell (diff)
signature
bin(wpox): script to handle starting warcprox
I should later add options from some array so users can change config
Diffstat (limited to 'bin')
-rwxr-xr-xbin/wpox22
1 files changed, 22 insertions, 0 deletions
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 \
+ "$@"