示例#1
0
文件: commands.go 项目: eeayiaia/scmt
func removeDevice(c *cli.Context) {
	// TODO: add validation
	mac := strings.Trim(c.Args().First(), " ")

	buffer := bytes.NewBufferString(mac)
	invoker.SendPacket(invoker.TYPE_REMOVE_DEVICE, *buffer)
}
示例#2
0
文件: commands.go 项目: eeayiaia/scmt
func registerDevice(c *cli.Context) {
	// TODO: add validation
	mac := strings.Trim(c.Args().First(), " ")
	ip := strings.Trim(c.Args().Get(1), " ")

	buffer := bytes.NewBufferString(mac + " " + ip)
	invoker.SendPacket(invoker.TYPE_NEW_DEVICE, *buffer)
}
示例#3
0
文件: commands.go 项目: eeayiaia/scmt
func stopDaemon(c *cli.Context) {
	if !daemon.IsDaemonized() {
		log.Error("No daemon is running!")
		return
	}

	invoker.SendPacket(invoker.TYPE_STOP_DAEMON, *bytes.NewBufferString(""))
	log.Info("Stopping the daemon ..")
}
示例#4
0
文件: commands.go 项目: eeayiaia/scmt
func installPlugin(c *cli.Context) {
	//TODO: handle installation of plugins on specific nodes only, examine
	buffer := bytes.NewBufferString(c.Args().First())
	buffer.WriteString(" ")
	invoker.SendPacket(invoker.TYPE_INSTALL_PLUGIN, *buffer)
}