apply: report a bit more info during an update run

this "splits" the output into sections so it's easier to attribute what
is curretly run. useful for debugging failures. in the end, the script
reports total CPU time it took to run the update.
dev
alex 1 year ago
parent 0273e3e9ca
commit d71d3f15eb
Signed by: x1ddos
GPG Key ID: 540189B756BF5B12

@ -2,27 +2,38 @@
# the script executes updates to a nakamochi system. # the script executes updates to a nakamochi system.
# it must be run as root or a user with equivalent privileges. # it must be run as root or a user with equivalent privileges.
# at script exit, report system/user CPU times it took to run
# the whole update while preserving exit code.
trap times EXIT
# abort if an expansion encounteres an unset variable.
set -u
exit_code=0 exit_code=0
# defined in the caller script # defined in the caller script
rootdir="$SYSUPDATES_ROOTDIR" rootdir="$SYSUPDATES_ROOTDIR"
# base os # base os
printf "######## base os\n" 1>&2
cd "$rootdir" cd "$rootdir"
./base/voidlinux.sh || exit 1 ./base/voidlinux.sh || exit 1
printf "######## tor\n" 1>&2
cd "$rootdir" cd "$rootdir"
./base/tor.sh || exit_code=$? ./base/tor.sh || exit_code=$?
# nakamochi daemon and gui (ndg) # nakamochi daemon and gui (ndg)
printf "######## ndg\n" 1>&2
cd "$rootdir" cd "$rootdir"
. ./ndg/env . ./ndg/env
ndg_apply || exit_code=$? ndg_apply || exit_code=$?
# bitcoin core # bitcoin core
printf "######## bitcoind\n" 1>&2
cd "$rootdir" cd "$rootdir"
. ./btc/env . ./btc/env
bitcoin_apply || exit_code=$? bitcoin_apply || exit_code=$?
# lnd lightning # lnd lightning
printf "######## lnd\n" 1>&2
cd "$rootdir" cd "$rootdir"
. ./lnd/env . ./lnd/env
lnd_apply || exit_code=$? lnd_apply || exit_code=$?

@ -30,7 +30,7 @@ fi
# start of the sysupdate; trim prevously logged runs # start of the sysupdate; trim prevously logged runs
date > $LOGFILE date > $LOGFILE
# fetch updates from remove # fetch updates from remote
cd "$REPODIR" cd "$REPODIR"
{ {
git fetch origin # in case the refspec is unknown locally yet git fetch origin # in case the refspec is unknown locally yet

Loading…
Cancel
Save