From 94a294481747b4b40b6f300f3a875063d552b560 Mon Sep 17 00:00:00 2001 From: Mahmoud Mousa Date: Fri, 20 Sep 2024 23:07:22 +0900 Subject: [PATCH] Clean up - Prelude script has everything we need --- cmd/init.go | 8 +------- utils/scripts.go | 11 ----------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/cmd/init.go b/cmd/init.go index ccb88ca..21865d8 100644 --- a/cmd/init.go +++ b/cmd/init.go @@ -82,7 +82,7 @@ var initCmd = &cobra.Command{ os.Exit(0) } - // init the sidekick system config + // init the sidekick system config && add public key to known_hosts preludeCmd := exec.Command("sh", "-s", "-", server) preludeCmd.Stdin = strings.NewReader(utils.PreludeScript) if preludeCmdErr := preludeCmd.Run(); preludeCmdErr != nil { @@ -98,12 +98,6 @@ var initCmd = &cobra.Command{ viper.Set("dockerUsername", dockerUsername) viper.Set("certEmail", certEmail) - keyAddSshCommand := exec.Command("sh", "-s", "-", server) - keyAddSshCommand.Stdin = strings.NewReader(utils.SshKeysScript) - if sshAddErr := keyAddSshCommand.Run(); sshAddErr != nil { - panic(sshAddErr) - } - multi := pterm.DefaultMultiPrinter setupProgressBar, _ := pterm.DefaultProgressbar.WithTotal(6).WithWriter(multi.NewWriter()).Start("Sidekick Booting up (2m estimated) ") rootLoginSpinner, _ := utils.GetSpinner().WithWriter(multi.NewWriter()).Start("Logging into with root") diff --git a/utils/scripts.go b/utils/scripts.go index 3c0cc04..ca1d145 100644 --- a/utils/scripts.go +++ b/utils/scripts.go @@ -14,17 +14,6 @@ limitations under the License. */ package utils -var SshKeysScript = ` - if [ "$#" -ne 1 ]; then - echo "Usage: $0 " - exit 1 - fi - - HOSTNAME=$1 - - ssh-keyscan -H $HOSTNAME >> ~/.ssh/known_hosts - ` - var DockerHandleScript = ` appName=$1 dockerUsername=$2