#!/bin/sh # script/run: build bin/smallwebwaf with script/build and run it, with # the settings in the environment. Unless SWWAF_STATE_DIR is set, the # state files go in bin/state, beside the binary. set -eu SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd -P)" ROOT="$(cd "$SCRIPT_DIR/.." && pwd -P)" main() { "$SCRIPT_DIR/build" if [ -z "${SWWAF_STATE_DIR+set}" ]; then SWWAF_STATE_DIR="$ROOT/bin/state" export SWWAF_STATE_DIR mkdir -p "$SWWAF_STATE_DIR" fi exec "$ROOT/bin/smallwebwaf" } main "$@"