MCPcopy
hub / github.com/seaweedfs/seaweedfs / runShell

Function runShell

weed/command/shell.go:40–75  ·  view source on GitHub ↗
(command *Command, args []string)

Source from the content-addressed store, hash-verified

38}
39
40func runShell(command *Command, args []string) bool {
41
42 util.LoadSecurityConfiguration()
43 shellOptions.GrpcDialOption = security.LoadClientTLS(util.GetViper(), "grpc.client")
44 shellOptions.Directory = "/"
45
46 util.LoadConfiguration("shell", false)
47 viper := util.GetViper()
48 cluster := viper.GetString("cluster.default")
49 if *shellCluster != "" {
50 cluster = *shellCluster
51 }
52
53 if *shellOptions.Masters == "" {
54 if cluster == "" {
55 *shellOptions.Masters = "localhost:9333"
56 } else {
57 *shellOptions.Masters = viper.GetString("cluster." + cluster + ".master")
58 }
59 }
60
61 filerAddress := *shellInitialFiler
62 if filerAddress == "" && cluster != "" {
63 filerAddress = viper.GetString("cluster." + cluster + ".filer")
64 }
65 shellOptions.FilerAddress = pb.ServerAddress(filerAddress)
66 shellOptions.Debug = *shellDebug
67 if shellOptions.Debug {
68 fmt.Fprintf(os.Stderr, "master: %s filer: %s\n", *shellOptions.Masters, shellOptions.FilerAddress)
69 }
70
71 shell.RunShell(shellOptions)
72
73 return true
74
75}

Callers

nothing calls this directly

Calls 7

LoadClientTLSFunction · 0.92
GetViperFunction · 0.92
LoadConfigurationFunction · 0.92
ServerAddressTypeAlias · 0.92
RunShellFunction · 0.92
GetStringMethod · 0.65

Tested by

no test coverage detected