#!/bin/sh
#
# Copyright (C) 2016-2018 The slide-switch authors
# https://github.com/jefferyto/openwrt-slide-switch
#
# slide-switch is free software, licensed under the GNU General Public License v2.
#

prefix=/usr
exec_prefix=/usr
datarootdir=${prefix}/share

. "/usr/share/slide-switch/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
