mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-02-24 13:30:02 +08:00
fix: Print to stderr
This commit is contained in:
parent
5365a9ed4e
commit
d793921bcf
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -Eeuo pipefail
|
set -Eeuo pipefail
|
||||||
|
|
||||||
info () { echo -e "\E[1;34m❯\E[1;36m $1\E[0m" ; }
|
info () { echo -e >&2 "\E[1;34m❯\E[1;36m $1\E[0m" ; }
|
||||||
error () { echo -e >&2 "\E[1;31m❯ ERROR: $1\E[0m" ; }
|
error () { echo -e >&2 "\E[1;31m❯ ERROR: $1\E[0m" ; }
|
||||||
|
|
||||||
retry=true
|
retry=true
|
||||||
@ -12,7 +12,10 @@ do
|
|||||||
sleep 2
|
sleep 2
|
||||||
|
|
||||||
# Retrieve IP from guest VM
|
# Retrieve IP from guest VM
|
||||||
|
|
||||||
|
set +e
|
||||||
RESPONSE=$(curl -s -m 16 -S http://127.0.0.1:2210/read?command=10 2>&1)
|
RESPONSE=$(curl -s -m 16 -S http://127.0.0.1:2210/read?command=10 2>&1)
|
||||||
|
set -e
|
||||||
|
|
||||||
if [[ ! "${RESPONSE}" =~ "\"success\"" ]] ; then
|
if [[ ! "${RESPONSE}" =~ "\"success\"" ]] ; then
|
||||||
error "Failed to connect to guest: $RESPONSE" && continue
|
error "Failed to connect to guest: $RESPONSE" && continue
|
||||||
@ -53,8 +56,8 @@ else
|
|||||||
MSG="http://${IP}:${PORT}"
|
MSG="http://${IP}:${PORT}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ""
|
echo "" >&2
|
||||||
info "--------------------------------------------------------"
|
info "--------------------------------------------------------"
|
||||||
info " You can now login to DSM at ${MSG}"
|
info " You can now login to DSM at ${MSG}"
|
||||||
info "--------------------------------------------------------"
|
info "--------------------------------------------------------"
|
||||||
echo ""
|
echo "" >&2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user