gocage console jailname now working

This commit is contained in:
yo
2022-06-18 11:08:03 +02:00
parent 0bf825ee5a
commit a446a19a08
2 changed files with 40 additions and 32 deletions

View File

@ -15,7 +15,12 @@ import (
)
const (
gVersion = "0.27c"
gVersion = "0.27d"
DEVFS_DEFAULT_RULESET = 4
// TODO : Get from $jail_zpool/defaults.json
MIN_DYN_DEVFS_RULESET = 1000
)
var (
@ -35,6 +40,7 @@ var (
gSnapshotName string
gMigrateDestPool string
gYesToAll bool
rootCmd = &cobra.Command{
Use: "gocage",
@ -97,17 +103,17 @@ ex: gocage list srv-db srv-web`,
WriteConfigToDisk(false)
},
}
/* shellCmd = &cobra.Command {
Use: "console",
Short: "Execute shell on jail",
Run: func(cmd *cobra.Command, args []string) {
// Load inventory
ListJails(args, false)
ShellJail(args)
},
}
*/
shellCmd = &cobra.Command {
Use: "console",
Short: "Execute shell on jail",
Run: func(cmd *cobra.Command, args []string) {
// Load inventory
ListJails(args, false)
ShellJail(args)
},
}
setCmd = &cobra.Command{
Use: "set",
Short: "Set a jail property",
@ -194,7 +200,7 @@ You can specify multiple jails.`,
migrateCmd = &cobra.Command{
Use: "migrate",
Short: "Migrate jail to another zpool",
Short: "Migrate jail to another zfs pool",
Run: func(cmd *cobra.Command, args []string) {
// Load inventory
ListJails(args, false)
@ -241,6 +247,7 @@ func init() {
snapshotRollbackCmd.MarkFlagRequired("snapname")
migrateCmd.Flags().StringVarP(&gMigrateDestPool, "destpool", "d", "", "Name of zfs destination pool for jail")
migrateCmd.Flags().BoolVarP(&gYesToAll, "yes", "y", false, "Answer yes to all questions")
migrateCmd.MarkFlagRequired("destpool")
// Now declare commands
@ -249,6 +256,7 @@ func init() {
listCmd.AddCommand(listPropsCmd)
rootCmd.AddCommand(stopCmd)
rootCmd.AddCommand(startCmd)
rootCmd.AddCommand(shellCmd)
rootCmd.AddCommand(getCmd)
rootCmd.AddCommand(setCmd)
rootCmd.AddCommand(snapshotCmd)