github.com/avahowell/sia@v0.5.1-beta.0.20160524050156-83dcc3d37c94/siac/daemoncmd.go (about)

     1  package main
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/spf13/cobra"
     7  )
     8  
     9  var (
    10  	stopCmd = &cobra.Command{
    11  		Use:   "stop",
    12  		Short: "Stop the Sia daemon",
    13  		Long:  "Stop the Sia daemon.",
    14  		Run:   wrap(stopcmd),
    15  	}
    16  )
    17  
    18  // stopcmd is the handler for the command `siac stop`.
    19  // Stops the daemon.
    20  func stopcmd() {
    21  	err := get("/daemon/stop")
    22  	if err != nil {
    23  		die("Could not stop daemon:", err)
    24  	}
    25  	fmt.Println("Sia daemon stopped.")
    26  }