diff options
| author | 2026-01-04 23:13:57 +0000 | |
|---|---|---|
| committer | 2026-01-04 23:13:57 +0000 | |
| commit | c02eb726811bb806cd586e79d657f8e664141654 (patch) | |
| tree | a5d32728e9f72d68c378ce50624d08f8d772cbf7 /bin | |
| parent | pkgs(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-x | bin/wpox | 22 |
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 \ + "$@" |
