a bunch of fixes and improvements
[automated-distro-installer] / dsfull
diff --git a/dsfull b/dsfull
index 29946f39804b3cfccbc7378fba17656167d207a0..709ddab407f1163cff037c8efb647701e1d5142a 100755 (executable)
--- a/dsfull
+++ b/dsfull
@@ -1,4 +1,4 @@
-#!/bin/bash -l
+#!/bin/bash
 # Copyright (C) 2016 Ian Kelling
 
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,7 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-x="$(readlink -f "$BASH_SOURCE")"; source "${x%/*}/bash-trace"
+if [[ -s ~/.bashrc ]];then . ~/.bashrc;fi
 
 reboot=true
 if [[ $1 == -r ]]; then
@@ -59,28 +59,27 @@ host=$1
 
 ##### end command line parsing ########
 
-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
-    fai-redep
-    myfai-chboot $host
-    e fai-kexec $host ||:
+    fai-redep
+    myfai-chboot $host
+    live-kexec $host ||:
 else
-    cleanup() { pxe-server; }; _errcatch_cleanup=cleanup
-    pxe-server $host fai
+    err-cleanup() { pxe-server; }
+    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
 
-    pxe-server -a
-    unset _errcatch_cleanup
+    pxe-server -a
+    unset err-cleanup
 fi
 
 error=true
@@ -91,7 +90,7 @@ for ((i=0; i<240; i++)); do
     fi
     sleep 5
 done
-faiserver-disable
+faiserver-disable
 if $error; then
     echo "$0: error: timeout"
     exit 1
@@ -99,6 +98,7 @@ 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
+# if we partitioned, we do this:
+#btrbk-run -t $host archive
+btrbk-run -t $host
+dsremote $host