mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Toughened for recent legacy installs etc, that lack STAGE=<value> in iiab.env
This commit is contained in:
parent
e3bf302ccd
commit
66c51a7367
1 changed files with 21 additions and 16 deletions
37
iiab-install
37
iiab-install
|
@ -1,13 +1,14 @@
|
||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
# running from a git repo
|
# Running from a git repo
|
||||||
# Add cmdline options for passing to ansible
|
# Add cmdline options for passing to ansible
|
||||||
# todo add proper shift to gobble up --debug --reinstall
|
# Todo add proper shift to gobble up --debug --reinstall
|
||||||
|
|
||||||
if [ "$1" != "--debug" ] && [ "$1" != "--reinstall" ] && [ "$1" != "" ]; then
|
if [ "$1" != "--debug" ] && [ "$1" != "--reinstall" ] && [ "$1" != "" ]; then
|
||||||
echo "Use 'iiab-install' for regular installs, or to continue an install."
|
echo "Use './iiab-install' for regular installs, or to continue an install."
|
||||||
echo "Use 'iiab-install --reinstall' to force running all Stages 0-9."
|
echo "Use './iiab-install --reinstall' to force running all Stages 0-9."
|
||||||
echo "Use 'iiab-install --debug' to run Stage 0, followed by Stages 3-9."
|
echo "Use './iiab-install --debug' to run Stage 0, followed by Stages 3-9."
|
||||||
echo "Use './runtags' to run a single Stage or Tag or Role."
|
echo "Use './runtags' to run a single Stage or Tag or Role."
|
||||||
|
echo "Use './iiab-network' to run Network sections."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -72,15 +73,18 @@ STAGE=0
|
||||||
if [ ! -f /etc/iiab/iiab.env ]; then
|
if [ ! -f /etc/iiab/iiab.env ]; then
|
||||||
mkdir -p /etc/iiab
|
mkdir -p /etc/iiab
|
||||||
else
|
else
|
||||||
source /etc/iiab/iiab.env
|
if [[ `grep STAGE= /etc/iiab/iiab.env` ]]; then
|
||||||
echo "Extracted STAGE="$STAGE" (counter) from /etc/iiab/iiab.env"
|
source /etc/iiab/iiab.env
|
||||||
if ! [ "$STAGE" -eq "$STAGE" ] 2> /dev/null; then
|
echo "Extracted STAGE="$STAGE" (counter) from /etc/iiab/iiab.env"
|
||||||
echo -e "\nEXITING: STAGE (counter) value == "$STAGE" is non-integer in /etc/iiab/iiab.env"
|
if ! [ "$STAGE" -eq "$STAGE" ] 2> /dev/null; then
|
||||||
exit 1
|
echo -e "\nEXITING: STAGE (counter) value == "$STAGE" is non-integer in /etc/iiab/iiab.env"
|
||||||
elif [ "$STAGE" -lt 1 ] || [ "$STAGE" -gt 9 ]; then
|
exit 1
|
||||||
echo -e "\nEXITING: STAGE (counter) value == "$STAGE" is out-of-range in /etc/iiab/iiab.env"
|
elif [ "$STAGE" -lt 1 ] || [ "$STAGE" -gt 9 ]; then
|
||||||
exit 1
|
echo -e "\nEXITING: STAGE (counter) value == "$STAGE" is out-of-range in /etc/iiab/iiab.env"
|
||||||
elif [[ `grep XSCE /etc/iiab/iiab.env` ]] || [ "$1" == "--reinstall" ]; then
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [[ `grep XSCE /etc/iiab/iiab.env` ]] || [ "$1" == "--reinstall" ]; then
|
||||||
STAGE=0
|
STAGE=0
|
||||||
rm /etc/iiab/iiab.env
|
rm /etc/iiab/iiab.env
|
||||||
echo "Removed /etc/iiab/iiab.env effectively resetting STAGE (counter)."
|
echo "Removed /etc/iiab/iiab.env effectively resetting STAGE (counter)."
|
||||||
|
@ -90,9 +94,10 @@ else
|
||||||
echo "Wrote STAGE=2 (counter) to /etc/iiab/iiab.env"
|
echo "Wrote STAGE=2 (counter) to /etc/iiab/iiab.env"
|
||||||
elif [ "$STAGE" -eq 9 ]; then
|
elif [ "$STAGE" -eq 9 ]; then
|
||||||
echo -e "\nEXITING: STAGE (counter) in /etc/iiab/iiab.env shows Stage 9 Is Already Done."
|
echo -e "\nEXITING: STAGE (counter) in /etc/iiab/iiab.env shows Stage 9 Is Already Done."
|
||||||
echo "Use 'iiab-install --reinstall' to force running all Stages 0-9."
|
echo "Use './iiab-install --reinstall' to force running all Stages 0-9."
|
||||||
echo "Use 'iiab-install --debug' to run Stage 0, followed by Stages 3-9."
|
echo "Use './iiab-install --debug' to run Stage 0, followed by Stages 3-9."
|
||||||
echo "Use './runtags' to run a single Stage or Tag or Role."
|
echo "Use './runtags' to run a single Stage or Tag or Role."
|
||||||
|
echo "Use './iiab-network' to run Network sections."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue