refresh_keys.go 527 B

123456789101112131415161718192021
  1. package host
  2. import (
  3. "github.com/gravitl/netmaker/cli/functions"
  4. "github.com/spf13/cobra"
  5. )
  6. var hostRefreshKeysCmd = &cobra.Command{
  7. Use: "refresh_keys [HOST ID] ",
  8. Args: cobra.MaximumNArgs(1),
  9. Short: "Refresh wireguard keys on host",
  10. Long: `Refresh wireguard keys on specified or all hosts
  11. If HOSTID is not specified, all hosts will be updated`,
  12. Run: func(cmd *cobra.Command, args []string) {
  13. functions.PrettyPrint(functions.RefreshKeys(args[0]))
  14. },
  15. }
  16. func init() {
  17. rootCmd.AddCommand(hostRefreshKeysCmd)
  18. }