codekasten/web-splash/web-splash.sh

32 lines
528 B
Bash
Raw Normal View History

2005-05-17 01:37:23 +02:00
#!/bin/sh
2005-05-17 02:26:11 +02:00
set -uex
2005-05-17 01:37:23 +02:00
2005-05-17 02:26:11 +02:00
. /etc/web-splash.conf
. /test/splash-functions.inc
2005-05-17 01:37:23 +02:00
ACTION="--help"
[ $# -gt 0 ] && ACTION="$1"
case "$ACTION" in
start|restart )
remove_old
init_chains
;;
stop )
remove_old
;;
2005-05-17 02:26:11 +02:00
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
;;
2005-05-17 01:37:23 +02:00
* )
echo "Syntax: $0 {start|stop|restart}"
echo
;;
esac