iankelling.org
/
git
/
automated-distro-installer
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
minor fixes and dns
[automated-distro-installer]
/
dsfull
diff --git
a/dsfull
b/dsfull
index 06af7f8f68e2ac0cd0f5fb768e83fcaf93dde284..91ab8ecfcb94b8427d62dc03f96e6fa767f46c79 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");
# Copyright (C) 2016 Ian Kelling
# Licensed under the Apache License, Version 2.0 (the "License");
@@
-13,9
+13,7
@@
# See the License for the specific language governing permissions and
# limitations under the License.
# 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
+if [[ -s ~/.bashrc ]];then . ~/.bashrc;fi
reboot=true
if [[ $1 == -r ]]; then
reboot=true
if [[ $1 == -r ]]; then
@@
-26,10
+24,15
@@
fi
usage() {
cat <<EOF
Usage: ${0##*/} [OPTIONS] HOST
usage() {
cat <<EOF
Usage: ${0##*/} [OPTIONS] HOST
-distro setup full using fai. (assuming we already synced data files to the host)
+"distro setup full" using fai.
+
+Note: relies on other repos and paths specific to Ian's system.
+Note: disables btrbk.timer. If it was active before, it should
+be manual reenabled after completion.
---no-r Don't ssh to host and reboot.
-k ssh to host and kexec, don't use pxe. implies --no-r
-k ssh to host and kexec, don't use pxe. implies --no-r
+--no-r Don't ssh to host and reboot. Use this for when you are
+ booting or rebooting from some other means.
-h|--help Print help and exit.
Note: Uses GNU getopt options parsing style
-h|--help Print help and exit.
Note: Uses GNU getopt options parsing style
@@
-56,28
+59,27
@@
host=$1
##### end command line parsing ########
##### end command line parsing ########
-
+ser stop btrbk.timer
if [[ ! $host ]]; then
echo "$0: error: expected 1 arg of hostname"
exit 1
fi
if [[ ! $host ]]; then
echo "$0: error: expected 1 arg of hostname"
exit 1
fi
-e() { echo "$@"; "$@"; }
if $kexec; then
if $kexec; then
-
e
fai-redep
-
e
myfai-chboot $host
-
e fai
-kexec $host ||:
+ fai-redep
+ myfai-chboot $host
+
live
-kexec $host ||:
else
else
- cleanup() { pxe-server; }
-
e
pxe-server $host fai
+
err-
cleanup() { pxe-server; }
+ pxe-server $host fai
if $reboot; then
# untested, this caused hang using here doc.
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
fi
-
e
pxe-server -a
- cleanup() { :; }
+ pxe-server -a
+ unset err-cleanup
fi
error=true
fi
error=true
@@
-88,8
+90,16
@@
for ((i=0; i<240; i++)); do
fi
sleep 5
done
fi
sleep 5
done
+faiserver-disable
if $error; then
echo "$0: error: timeout"
exit 1
fi
if $error; then
echo "$0: error: timeout"
exit 1
fi
-e dsremote $host
+while [[ $(ser is-active btrbk.service) == active ]]; do
+ sleep 5
+done
+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