Add gocage restart $jailname

This commit is contained in:
yo 2022-07-14 10:57:57 +02:00
parent cbdcb039cb
commit bf1037c1d3

View File

@ -14,7 +14,7 @@ import (
)
const (
gVersion = "0.29d"
gVersion = "0.29e"
// TODO : Get from $jail_zpool/defaults.json
MIN_DYN_DEVFS_RULESET = 1000
@ -113,6 +113,18 @@ ex: gocage list srv-db srv-web`,
},
}
restartCmd = &cobra.Command{
Use: "restart",
Short: "restart jail",
Run: func(cmd *cobra.Command, args []string) {
// Load inventory
ListJails(args, false)
StopJail(args)
StartJail(args)
WriteConfigToDisk(false)
},
}
shellCmd = &cobra.Command {
Use: "console",
Short: "Execute shell on jail",
@ -307,6 +319,7 @@ func init() {
listCmd.AddCommand(listPropsCmd)
rootCmd.AddCommand(stopCmd)
rootCmd.AddCommand(startCmd)
rootCmd.AddCommand(restartCmd)
rootCmd.AddCommand(shellCmd)
rootCmd.AddCommand(getCmd)
rootCmd.AddCommand(setCmd)