This is an automated email from the ASF dual-hosted git repository.

miaoliyao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/shardingsphere-on-cloud.git


The following commit(s) were added to refs/heads/main by this push:
     new 875e4f9  feat: get shell from env (#200)
875e4f9 is described below

commit 875e4f9100383ef2170264859a318537c88fdf6b
Author: lltgo <[email protected]>
AuthorDate: Mon Feb 13 19:05:15 2023 +0800

    feat: get shell from env (#200)
---
 pitr/agent/main.go | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/pitr/agent/main.go b/pitr/agent/main.go
index bebaecb..73606a3 100644
--- a/pitr/agent/main.go
+++ b/pitr/agent/main.go
@@ -51,7 +51,6 @@ var (
        port     string
        tlsCrt   string
        tlsKey   string
-       shell    string
 )
 
 func init() {
@@ -61,13 +60,16 @@ func init() {
 
        flag.StringVar(&tlsCrt, "tlsCrt", "", "Require:TLS certificate file 
path")
        flag.StringVar(&tlsKey, "tlsKey", "", "Require:TLS key file path")
-
-       flag.StringVar(&shell, "shell", "/bin/sh", "Shell path")
 }
 
 func main() {
        flag.Parse()
 
+       shell := os.Getenv("SHELL")
+       if shell == "" {
+               panic(fmt.Errorf("shell does not exist"))
+       }
+
        if strings.Trim(tlsCrt, " ") == "" || strings.Trim(tlsKey, " ") == "" {
                panic(fmt.Errorf("lack of HTTPs certificate"))
        }

Reply via email to