31 lines
535 B
Bash
Executable file
31 lines
535 B
Bash
Executable file
#!/bin/sh
|
|
|
|
set -ue
|
|
|
|
. /etc/web-splash.conf
|
|
. "$SPLASH_BIN/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
|