diff --git a/.pct-helpers b/.pct-helpers index 9d7979b..aff430d 100644 --- a/.pct-helpers +++ b/.pct-helpers @@ -263,9 +263,14 @@ xreadYes(){ } # -# xreadpass VAR +# xreadpass [msg] VAR # xreadpass(){ + local msg + if [[ $# == 2 ]] ; then + msg=" $1 " + shift + fi if [[ ${!1} == 'SKIP' ]] ; then return fi @@ -276,7 +281,7 @@ xreadpass(){ local PASS1 local PASS2 for attempt in 1 2 3 ; do - read -sep "${prefix}password (Enter to skip): " PASS1 + read -sep "${prefix}${msg}password (Enter to skip): " PASS1 echo if [ -z $PASS1 ] ; then return diff --git a/Makefile b/Makefile index 85078d4..cc2a30c 100644 --- a/Makefile +++ b/Makefile @@ -63,12 +63,12 @@ FORCE: # XXX should thisbe an env var or an arg to make.sh??? %-bootstrap: export BOOTSTRAP=1 %-bootstrap: % - true + @true %-bootstrap-clean: export BOOTSTRAP_CLEAN=1 %-bootstrap-clean: % - true + @true %: config %/make.sh FORCE @@ -110,10 +110,11 @@ gate: gate-traefik .PHONY: bootstrap bootstrap: host-bootstrap gate-bootstrap \ ns \ + wireguard \ bootstrap-clean .PHONY: bootstrap-clean -bootstrap-clean: host-bootstrap-clean +bootstrap-clean: gate-bootstrap-clean host-bootstrap-clean diff --git a/gate-traefik/make.sh b/gate-traefik/make.sh index 9a23de1..8811a5b 100755 --- a/gate-traefik/make.sh +++ b/gate-traefik/make.sh @@ -42,13 +42,15 @@ REBOOT=${REBOOT:=1} # Bootstrap cleanup... if ! [ -z $BOOTSTRAP_CLEAN ] ; then + ID=${GATE_ID:=${DFL_ID}} + xread "ID: " ID readBridgeVars # XXX update WAN ip... (???) # XXX - echo "# Reverting to WAN bridge..." + echo "# Reverting gate's WAN bridge to vmbr${WAN_BRIDGE}..." @ sed -i \ -e 's/^\(net0.*vmbr\)'${ADMIN_BRIDGE}'/\1'${WAN_BRIDGE}'/' \ /etc/pve/lxc/${ID}.conf @@ -60,6 +62,7 @@ fi # Bootstrap... if ! [ -z $BOOTSTRAP ] ; then + # this will allow the bootstrapped CTs to access the network... WAN_BRIDGE=$ADMIN_BRIDGE #DFL_CTHOSTNAME=${DFL_CTHOSTNAME}-bootstrap fi diff --git a/host/make.sh b/host/make.sh index a7bb5f7..5fb148e 100755 --- a/host/make.sh +++ b/host/make.sh @@ -35,12 +35,35 @@ SOFTWARE=( tmux ) +# XXX +#BRIDGES_TPL=bridges.tpl BRIDGES_TPL=bootstrap-bridges.tpl # XXX #readVars +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Bootstrap... + +if ! [ -z $BOOTSTRAP_CLEAN ] ; then + # XXX switch admin interface IP and Gateway to admin net... + # XXX + exit +fi + + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Bootstrap... + +if ! [ -z $BOOTSTRAP ] ; then + # XXX + BRIDGES_TPL=bootstrap-bridges.tpl + true +fi + + + #---------------------------------------------------------------------- # Tools