You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
899 B

13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
  1. package command
  2. import (
  3. "github.com/chrislusf/seaweedfs/weed/security"
  4. "github.com/chrislusf/seaweedfs/weed/shell"
  5. "github.com/chrislusf/seaweedfs/weed/util"
  6. "github.com/spf13/viper"
  7. )
  8. var (
  9. shellOptions shell.ShellOptions
  10. )
  11. func init() {
  12. cmdShell.Run = runShell // break init cycle
  13. shellOptions.Masters = cmdShell.Flag.String("master", "localhost:9333", "comma-separated master servers")
  14. }
  15. var cmdShell = &Command{
  16. UsageLine: "shell",
  17. Short: "run interactive administrative commands",
  18. Long: `run interactive administrative commands.
  19. `,
  20. }
  21. var ()
  22. func runShell(command *Command, args []string) bool {
  23. util.LoadConfiguration("security", false)
  24. shellOptions.GrpcDialOption = security.LoadClientTLS(viper.Sub("grpc"), "client")
  25. shellOptions.FilerHost = "localhost"
  26. shellOptions.FilerPort = 8888
  27. shellOptions.Directory = "/"
  28. shell.RunShell(shellOptions)
  29. return true
  30. }