You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by mi...@apache.org on 2023/02/13 11:05:21 UTC
[shardingsphere-on-cloud] branch main updated: feat: get shell from env (#200)
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 <ll...@outlook.com>
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"))
}