Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alist-org
GitHub Repository: alist-org/alist
Path: blob/main/cmd/restart.go
1541 views
1
/*
2
Copyright © 2022 NAME HERE <EMAIL ADDRESS>
3
*/
4
package cmd
5
6
import (
7
"github.com/spf13/cobra"
8
)
9
10
// RestartCmd represents the restart command
11
var RestartCmd = &cobra.Command{
12
Use: "restart",
13
Short: "Restart alist server by daemon/pid file",
14
Run: func(cmd *cobra.Command, args []string) {
15
stop()
16
start()
17
},
18
}
19
20
func init() {
21
RootCmd.AddCommand(RestartCmd)
22
23
// Here you will define your flags and configuration settings.
24
25
// Cobra supports Persistent Flags which will work for this command
26
// and all subcommands, e.g.:
27
// restartCmd.PersistentFlags().String("foo", "", "A help for foo")
28
29
// Cobra supports local flags which will only run when this command
30
// is called directly, e.g.:
31
// restartCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
32
}
33
34