#!/bin/sh set -uex . /etc/web-splash.conf . /test/splash-functions.inc ACTION="--help" [ $# -gt 0 ] && ACTION="$1" case "$ACTION" in start|restart ) remove_old init_chains ;; stop ) remove_old ;; register ) [ $# -gt 2 ] && echo "[WEB_SPLASH] too many parameters: only one IP address is allowed" && exit 1 [ $# -lt 2 ] && echo "[WEB_SPLASH] you have to specify an IP address" && exit 2 register_IP "$2" ;; update ) refresh_IP_list ;; * ) echo "Syntax: $0 {start|stop|restart}" echo ;; esac