#!/bin/sh

. /usr/share/libubox/jshn.sh

case "$1" in
        list)
                echo '{ "start" : {"name":"str"}, "stop" : {"name":"str"} }'
        ;;
        call)
                case "$2" in
                	start)
						read input;
						json_load "$input"
						json_get_var name name
						echo "lxc-start -n $name" >/dev/console
						json_init
						var="true"
						if [ -n "${name}" ]; then
							var=$(lxc-start -n $name)
						fi
						json_add_string status "$var"
						json_dump
					;;
                	stop)
						read input;
						json_load "$input"
						json_get_var name name
						json_init
						var="true"
						if [ -n "${name}" ]; then
							var=$(lxc-stop -n $name)
						fi
						json_add_string status "$var"
						json_dump
					;;
                esac
        ;;
esac

