2015-07-06 15:55:49 +00:00
|
|
|
#!/bin/bash -x
|
2015-06-16 23:56:22 +00:00
|
|
|
|
2015-07-06 15:55:49 +00:00
|
|
|
CMD="-v --showtrace install -c /tmp/subiquity-config.yaml cp:///"
|
2015-06-16 23:56:22 +00:00
|
|
|
CURTIN="/usr/local/curtin/bin/curtin"
|
|
|
|
OUTPUT="/tmp/.curtin_wrap_ran"
|
2015-07-06 19:00:50 +00:00
|
|
|
INSTALL_OK="Installation finished. No error reported."
|
2015-06-16 23:56:22 +00:00
|
|
|
|
|
|
|
if [ -e $CURTIN ]; then
|
|
|
|
$CURTIN $CMD | tee -a $OUTPUT
|
2015-07-06 15:55:49 +00:00
|
|
|
RV=$?
|
2015-06-16 23:56:22 +00:00
|
|
|
else
|
2015-07-06 15:55:49 +00:00
|
|
|
RV=1
|
2015-06-16 23:56:22 +00:00
|
|
|
echo "$CURTIN not found" > $OUTPUT
|
|
|
|
echo $CURTIN $CMD | tee -a $OUTPUT
|
|
|
|
fi
|
2015-07-06 19:00:50 +00:00
|
|
|
|
|
|
|
if tail -n 1 $OUTPUT | grep -q "$INSTALL_OK"; then
|
|
|
|
echo "Curtin installed OK, shutting down (Press Any Key)"
|
|
|
|
read a
|
2015-07-06 15:55:49 +00:00
|
|
|
echo "Shutting down after running $CURTIN $CMD"
|
2015-07-06 19:00:50 +00:00
|
|
|
telinit 0
|
2015-07-06 15:55:49 +00:00
|
|
|
else
|
|
|
|
echo "Error running curting, exiting..."
|
|
|
|
exit 1;
|
|
|
|
fi
|