From d62019c30b4fb115264557c170df02d0c5b0e747 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sat, 19 Oct 2024 21:52:42 +0300 Subject: [PATCH] better defaults... Signed-off-by: Alex A. Naanou --- .pct-helpers | 5 ++++- host/make.sh | 32 +++++++++++++++++++++++--------- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/.pct-helpers b/.pct-helpers index ed1aa44..2f734f2 100644 --- a/.pct-helpers +++ b/.pct-helpers @@ -231,7 +231,10 @@ xreadYes(){ return fi 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 no=N local dfl= diff --git a/host/make.sh b/host/make.sh index 4e8ab87..8e64e32 100755 --- a/host/make.sh +++ b/host/make.sh @@ -53,10 +53,22 @@ if ! [ -z $BOOTSTRAP_CLEAN ] ; then # stage 1: bootstrap -> clean if [ -e "$INTERFACES".clean ] ; then @ 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 elif [ -e "$INTERFACES".final ] ; then @ 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 exit fi @@ -69,19 +81,21 @@ if ! [ -z $BOOTSTRAP_CLEAN ] ; then @ ifreload -a fi fi - exit -fi + #exit - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Bootstrap... - -# XXX -if ! [ -z $BOOTSTRAP ] ; then +elif ! [ -z $BOOTSTRAP ] ; then DFL_BOOTSTRAP_PORT=${DFL_BOOTSTRAP_PORT:-none} xread "Bootstrap port: " BOOTSTRAP_PORT 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 @@ -211,7 +225,7 @@ if xreadYes "# Update /etc/hosts?" HOSTS ; then @ cp /etc/hosts{,.bak} @ cp /etc/hosts{,.new} @ sed -i \ - -e 's/^[^#].* \(pve.local.*\)$/'${HOST_ADMIN_IP/\/*}'\1/' \ + -e 's/^[^#].* \(pve.local.*\)$/'${HOST_ADMIN_IP/\/*}' \1/' \ /etc/hosts.new reviewApplyChanges /etc/hosts fi