#!/bin/sh
#
# src/usr/sbin/slide-switch.sh-cut.in
# This file is part of slide-switch.
#
# Copyright (C) 2016 Jeffery To
# https://github.com/jefferyto/openwrt-slide-switch
#
# slide-switch is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2 as published by the Free Software Foundation.
#
# slide-switch is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with slide-switch.  If not, see <http://www.gnu.org/licenses/>.
#
# --8<---- CUT HERE
#!/bin/sh
#
# Copyright (C) 2016 Jeffery To
# https://github.com/jefferyto/openwrt-slide-switch
#
# slide-switch is free software, licensed under the GNU General Public License v2.
#

prefix=@prefix@
exec_prefix=@exec_prefix@
datarootdir=@datarootdir@

. "@datadir@/@PACKAGE_NAME@/functions.sh"

case $1 in
	init)
		# $2 optional: "force" to force init
		do_init "$2"
		;;
	update)
		# $2 optional: button name from button event
		do_update "$2"
		;;
	switch)
		do_switch
		;;
	position)
		# $2 optional: switch name
		do_position "$2"
		;;
	boot)
		# $2 required: "enable" or "disable"
		do_boot "$2"
		;;
	-v|--version)
		do_version
		;;
	*)
		exit $ex_usage
		;;
esac
