better defaults...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2024-10-19 21:52:42 +03:00
parent 747ba1766f
commit d62019c30b
2 changed files with 27 additions and 10 deletions

View File

@ -231,7 +231,10 @@ xreadYes(){
return return
fi fi
if [ -z ${!var} ] ; then if [ -z ${!var} ] ; then
if [ -z $(eval "echo \$DFL_${var}") ] ; then if [[ "$(eval "echo \$DFL_${var}")" == "SKIP" ]] ; then
eval "$var="
return
elif [ -z $(eval "echo \$DFL_${var}") ] ; then
local yes=y local yes=y
local no=N local no=N
local dfl= local dfl=

View File

@ -53,10 +53,22 @@ if ! [ -z $BOOTSTRAP_CLEAN ] ; then
# stage 1: bootstrap -> clean # stage 1: bootstrap -> clean
if [ -e "$INTERFACES".clean ] ; then if [ -e "$INTERFACES".clean ] ; then
@ mv "$INTERFACES"{.clean,.new} @ mv "$INTERFACES"{.clean,.new}
DFL_UPDATE=SKIP
DFL_APPS=SKIP
DFL_BRIDGES=SKIP
DFL_HOSTS=SKIP
DFL_DNS=1
DFL_FIREWALL=SKIP
# stage 2: clean -> final # stage 2: clean -> final
elif [ -e "$INTERFACES".final ] ; then elif [ -e "$INTERFACES".final ] ; then
@ mv "$INTERFACES"{.final,.new} @ mv "$INTERFACES"{.final,.new}
# donw DFL_UPDATE=SKIP
DFL_APPS=SKIP
DFL_BRIDGES=SKIP
DFL_HOSTS=1
DFL_DNS=SKIP
DFL_FIREWALL=1
# done
else else
exit exit
fi fi
@ -69,19 +81,21 @@ if ! [ -z $BOOTSTRAP_CLEAN ] ; then
@ ifreload -a @ ifreload -a
fi fi
fi fi
exit #exit
fi
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Bootstrap... # Bootstrap...
elif ! [ -z $BOOTSTRAP ] ; then
# XXX
if ! [ -z $BOOTSTRAP ] ; then
DFL_BOOTSTRAP_PORT=${DFL_BOOTSTRAP_PORT:-none} DFL_BOOTSTRAP_PORT=${DFL_BOOTSTRAP_PORT:-none}
xread "Bootstrap port: " BOOTSTRAP_PORT xread "Bootstrap port: " BOOTSTRAP_PORT
BRIDGES_BOOTSTRAP_TPL=bootstrap-bridges.tpl BRIDGES_BOOTSTRAP_TPL=bootstrap-bridges.tpl
DFL_UPDATE=1
DFL_APPS=1
DFL_BRIDGES=1
DFL_HOSTS=SKIP
DFL_DNS=SKIP
DFL_FIREWALL=SKIP
fi fi
@ -211,7 +225,7 @@ if xreadYes "# Update /etc/hosts?" HOSTS ; then
@ cp /etc/hosts{,.bak} @ cp /etc/hosts{,.bak}
@ cp /etc/hosts{,.new} @ cp /etc/hosts{,.new}
@ sed -i \ @ sed -i \
-e 's/^[^#].* \(pve.local.*\)$/'${HOST_ADMIN_IP/\/*}'\1/' \ -e 's/^[^#].* \(pve.local.*\)$/'${HOST_ADMIN_IP/\/*}' \1/' \
/etc/hosts.new /etc/hosts.new
reviewApplyChanges /etc/hosts reviewApplyChanges /etc/hosts
fi fi