mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 19:13:34 +00:00
fix concurrent output in install.sh
This commit is contained in:
@@ -37,10 +37,6 @@ func provisionMachine(ctx context.Context, exec sshexec.Executor) error {
|
|||||||
"curl -fsSL %s | %s %s bash", sshexec.Quote(installScriptURL), sudoPrefix, sshexec.Quote(env),
|
"curl -fsSL %s | %s %s bash", sshexec.Quote(installScriptURL), sudoPrefix, sshexec.Quote(env),
|
||||||
)
|
)
|
||||||
cmd := sshexec.QuoteCommand("bash", "-c", "set -o pipefail; "+curlBashCmd)
|
cmd := sshexec.QuoteCommand("bash", "-c", "set -o pipefail; "+curlBashCmd)
|
||||||
// TODO: figure out why sometimes the output of `docker version` within the script is intermixed with other
|
|
||||||
// script output. Note, that the same behavior is observed when using exec.Run but not when running the script
|
|
||||||
// using ssh CLI. Requesting a pseudo-terminal may help fix this issue:
|
|
||||||
// session.RequestPty("xterm", 40, 80, ssh.TerminalModes{})
|
|
||||||
if err = exec.Stream(ctx, cmd, os.Stdout, os.Stderr); err != nil {
|
if err = exec.Stream(ctx, cmd, os.Stdout, os.Stderr); err != nil {
|
||||||
return fmt.Errorf("download and run install script: %w", err)
|
return fmt.Errorf("download and run install script: %w", err)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-2
@@ -11,8 +11,7 @@ UNCLOUD_GROUP="uncloud"
|
|||||||
UNCLOUD_GROUP_ADD_USER=${UNCLOUD_GROUP_ADD_USER:-}
|
UNCLOUD_GROUP_ADD_USER=${UNCLOUD_GROUP_ADD_USER:-}
|
||||||
|
|
||||||
log() {
|
log() {
|
||||||
echo $1
|
echo -e "\033[1;32m$1\033[0m"
|
||||||
#echo -e "\033[1;32m$1\033[0m" >&2
|
|
||||||
}
|
}
|
||||||
|
|
||||||
error() {
|
error() {
|
||||||
|
|||||||
Reference in New Issue
Block a user