X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=dsfull;h=5cc0fad0a972de334be5db84f5866aba3d5b1a1a;hb=659fbf0c0467af986aadb6d76693eb3011e62ac4;hp=417635014c3d8413649d7c03bb9c2ac9b92e7163;hpb=efcfb463ceda4de1d9953da31a2c0737471e5cf8;p=automated-distro-installer diff --git a/dsfull b/dsfull index 4176350..5cc0fad 100755 --- a/dsfull +++ b/dsfull @@ -13,9 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set -eE -o pipefail -cleanup() { :; } -trap 'cleanup; echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR +x="$(readlink -f "$BASH_SOURCE")"; source "${x%/*}/bash-trace" reboot=true if [[ $1 == -r ]]; then @@ -61,28 +59,27 @@ host=$1 ##### end command line parsing ######## -e ser stop btrbk.timer +ser stop btrbk.timer if [[ ! $host ]]; then echo "$0: error: expected 1 arg of hostname" exit 1 fi -e() { echo "$@"; "$@"; } if $kexec; then - e fai-redep - e myfai-chboot $host - e fai-kexec $host ||: + fai-redep + myfai-chboot $host + fai-kexec $host ||: else - cleanup() { pxe-server; } - e pxe-server $host fai + cleanup() { pxe-server; }; _errcatch_cleanup=cleanup + pxe-server $host fai if $reboot; then # untested, this caused hang using here doc. - ssh $host "touch /tmp/keyscript-off; sudo reboot" ||: & + ssh root@$host "touch /tmp/keyscript-off; reboot" ||: & fi - e pxe-server -a - cleanup() { :; } + pxe-server -a + unset _errcatch_cleanup fi error=true @@ -93,7 +90,7 @@ for ((i=0; i<240; i++)); do fi sleep 5 done -e faiserver-disable +faiserver-disable if $error; then echo "$0: error: timeout" exit 1 @@ -101,6 +98,8 @@ fi while [[ $(ser is-active btrbk.service) == active ]]; do sleep 5 done -e btrbk-run -t $host -ssh $host /a/bin/distro-setup/distro-begin -#e dsremote $host +btrbk-run -t $host +#ssh $host /a/bin/distro-setup/distro-begin +# this should be done instead of distro-begin, but +# keeping it to 2 steps for now +dsremote $host