package cmd

import (
	"syscall"

	"github.com/spf13/cobra"
)

var daemonStopCmd = &cobra.Command{
	Use:   "stop",
	Short: "Stop a daemon",
	Long:  "",
	RunE: func(cmd *cobra.Command, args []string) error {

		syscall.Kill(syscall.Getpid(), syscall.SIGTERM)

		return nil
	},
}

func init() {
	daemon.AddCommand()
}

package cmd

import (
	"github.com/spf13/cobra"
)

var daemonStopCmd = &cobra.Command{
	Use:   "stop",
	Short: "Stop a daemon",
	Long:  "",
	RunE: func(cmd *cobra.Command, args []string) error {
		_, err := restClient.R().Post("/api/v1/stop")
		return err
	},
}

func init() {
	daemon.AddCommand(daemonStopCmd)
}

Add command to stop the daemon
Add command to stop the daemon
