mirror of
https://github.com/aljazceru/cyphernode.git
synced 2025-12-28 10:05:18 +01:00
log and logline instead of trace
This commit is contained in:
17
dist/setup.sh
vendored
17
dist/setup.sh
vendored
@@ -20,6 +20,17 @@ trace()
|
||||
echo -n "[$(date +%Y-%m-%dT%H:%M:%S%z)] ${1}" > /dev/stderr
|
||||
fi
|
||||
}
|
||||
|
||||
log()
|
||||
{
|
||||
echo -n "${1}" > /dev/stderr
|
||||
}
|
||||
|
||||
logline()
|
||||
{
|
||||
echo "${1}" > /dev/stderr
|
||||
}
|
||||
|
||||
# FROM: https://stackoverflow.com/questions/5195607/checking-bash-exit-status-of-several-commands-efficiently
|
||||
# Use step(), try(), and next() to perform a series of commands and print
|
||||
# [ OK ] or [FAILED] at the end. The step as a whole fails if any individual
|
||||
@@ -31,7 +42,7 @@ trace()
|
||||
# try mount -o remount,rw /boot
|
||||
# next
|
||||
step() {
|
||||
trace "$@"
|
||||
log "$@"
|
||||
|
||||
STEP_OK=0
|
||||
[[ -w /tmp ]] && echo $STEP_OK > /tmp/step.$$
|
||||
@@ -264,12 +275,12 @@ if [[ $CONFIGURE == 0 && $INSTALL == 0 && $RECREATE == 0 ]]; then
|
||||
fi
|
||||
|
||||
if [[ $CONFIGURE == 1 ]]; then
|
||||
trace "Starting configuration phase" && echo
|
||||
logline "Configuration phase"
|
||||
configure $RECREATE
|
||||
fi
|
||||
|
||||
if [[ $INSTALL == 1 ]]; then
|
||||
trace "Starting installation phase" && echo
|
||||
logline "Starting installation phase"
|
||||
install
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user