From bf1037c1d3bb1dfd20f2541c21733752daa8bf84 Mon Sep 17 00:00:00 2001 From: yo Date: Thu, 14 Jul 2022 10:57:57 +0200 Subject: [PATCH] Add gocage restart $jailname --- cmd/root.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/cmd/root.go b/cmd/root.go index 8be4c2d..9529684 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -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)