mirror of
https://github.com/ivanilves/xiringuito.git
synced 2025-05-16 07:10:09 -07:00
Make error messages more clear
This commit is contained in:
parent
5d0c3e6d35
commit
5c0ff25c35
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# Bootstrap sudoers.d config on server side before doing anything else!
|
# Bootstrap sudoers.d config on server side before doing anything else!
|
||||||
#
|
#
|
||||||
set -e
|
set -eo pipefail
|
||||||
|
|
||||||
if [[ ${#} -lt 1 ]]; then
|
if [[ ${#} -lt 1 ]]; then
|
||||||
echo "Usage: ${0} [OPTIONS] [SSH_USER@]SSH_SERVER"
|
echo "Usage: ${0} [OPTIONS] [SSH_USER@]SSH_SERVER"
|
||||||
@ -17,4 +17,4 @@ declare -r STDOUTERR=/tmp/xiringuito.$(basename ${0}).${USER}
|
|||||||
ssh -t -oStrictHostKeyChecking=no ${@} \
|
ssh -t -oStrictHostKeyChecking=no ${@} \
|
||||||
"sudo true && sudo bash -c \
|
"sudo true && sudo bash -c \
|
||||||
\"umask 0337 && echo -e ${SUDO_NOTE}'\n'\${USER} ${SUDO_CONF} | tee ${BASE_NAME}-\${USER}\" >/dev/null" \
|
\"umask 0337 && echo -e ${SUDO_NOTE}'\n'\${USER} ${SUDO_CONF} | tee ${BASE_NAME}-\${USER}\" >/dev/null" \
|
||||||
&>${STDOUTERR}
|
&>${STDOUTERR} || (cat ${STDOUTERR} >>/dev/stderr && exit 1)
|
||||||
|
14
xaval
14
xaval
@ -271,6 +271,8 @@ function wait_connection(){
|
|||||||
local WAIT_TIME=0
|
local WAIT_TIME=0
|
||||||
while [[ "$(get_profile_status ${PROFILE})" != "UP" ]]; do
|
while [[ "$(get_profile_status ${PROFILE})" != "UP" ]]; do
|
||||||
if [[ ${WAIT_TIME} -ge ${WAIT_TIMEOUT} ]]; then
|
if [[ ${WAIT_TIME} -ge ${WAIT_TIMEOUT} ]]; then
|
||||||
|
dump_profile_log ${PROFILE}
|
||||||
|
|
||||||
commit_suicide "Unable to bring up \"${PROFILE}\" after ${WAIT_TIMEOUT} seconds"
|
commit_suicide "Unable to bring up \"${PROFILE}\" after ${WAIT_TIMEOUT} seconds"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -303,6 +305,18 @@ function logs_profile() {
|
|||||||
echo "STATUS: $(get_profile_status ${PROFILE})"
|
echo "STATUS: $(get_profile_status ${PROFILE})"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function dump_profile_log() {
|
||||||
|
local PROFILE=${1}
|
||||||
|
|
||||||
|
suicide_on_absent_profile ${PROFILE}
|
||||||
|
|
||||||
|
local LOG_FILE=${LOG_DIR}/${PROFILE}
|
||||||
|
|
||||||
|
echo "--- LOG ---" >>/dev/stderr
|
||||||
|
cat ${LOG_FILE} >>/dev/stderr
|
||||||
|
echo "--- LOG ---" >>/dev/stderr
|
||||||
|
}
|
||||||
|
|
||||||
function rename_profile(){
|
function rename_profile(){
|
||||||
local OLD_PROFILE=${1}
|
local OLD_PROFILE=${1}
|
||||||
local NEW_PROFILE=${2}
|
local NEW_PROFILE=${2}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user