mirror of
https://github.com/flynx/proxmox-utils.git
synced 2025-12-26 05:12:06 +00:00
Compare commits
8 Commits
bf48fd61b5
...
73b4a27b9d
| Author | SHA1 | Date | |
|---|---|---|---|
| 73b4a27b9d | |||
| a31ff44a64 | |||
| 666f3896c3 | |||
| 6f923c45e9 | |||
| 3d05258695 | |||
| e3d38969a6 | |||
| a26894a879 | |||
| c40a27f447 |
11
.pct-helpers
11
.pct-helpers
@ -263,9 +263,14 @@ xreadYes(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# xreadpass VAR
|
# xreadpass [msg] VAR
|
||||||
#
|
#
|
||||||
xreadpass(){
|
xreadpass(){
|
||||||
|
local msg
|
||||||
|
if [[ $# == 2 ]] ; then
|
||||||
|
msg="$1 "
|
||||||
|
shift
|
||||||
|
fi
|
||||||
if [[ ${!1} == 'SKIP' ]] ; then
|
if [[ ${!1} == 'SKIP' ]] ; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
@ -276,7 +281,7 @@ xreadpass(){
|
|||||||
local PASS1
|
local PASS1
|
||||||
local PASS2
|
local PASS2
|
||||||
for attempt in 1 2 3 ; do
|
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
|
echo
|
||||||
if [ -z $PASS1 ] ; then
|
if [ -z $PASS1 ] ; then
|
||||||
return
|
return
|
||||||
@ -513,7 +518,7 @@ readVars(){
|
|||||||
|
|
||||||
# root password...
|
# root password...
|
||||||
if [ -z $ROOTPASS ] ; then
|
if [ -z $ROOTPASS ] ; then
|
||||||
xreadpass PASS \
|
xreadpass root PASS \
|
||||||
|| exit 1
|
|| exit 1
|
||||||
else
|
else
|
||||||
PASS=$ROOTPASS
|
PASS=$ROOTPASS
|
||||||
|
|||||||
7
Makefile
7
Makefile
@ -63,12 +63,12 @@ FORCE:
|
|||||||
# XXX should thisbe an env var or an arg to make.sh???
|
# XXX should thisbe an env var or an arg to make.sh???
|
||||||
%-bootstrap: export BOOTSTRAP=1
|
%-bootstrap: export BOOTSTRAP=1
|
||||||
%-bootstrap: %
|
%-bootstrap: %
|
||||||
true
|
@true
|
||||||
|
|
||||||
|
|
||||||
%-bootstrap-clean: export BOOTSTRAP_CLEAN=1
|
%-bootstrap-clean: export BOOTSTRAP_CLEAN=1
|
||||||
%-bootstrap-clean: %
|
%-bootstrap-clean: %
|
||||||
true
|
@true
|
||||||
|
|
||||||
|
|
||||||
%: config %/make.sh FORCE
|
%: config %/make.sh FORCE
|
||||||
@ -110,10 +110,11 @@ gate: gate-traefik
|
|||||||
.PHONY: bootstrap
|
.PHONY: bootstrap
|
||||||
bootstrap: host-bootstrap gate-bootstrap \
|
bootstrap: host-bootstrap gate-bootstrap \
|
||||||
ns \
|
ns \
|
||||||
|
wireguard \
|
||||||
bootstrap-clean
|
bootstrap-clean
|
||||||
|
|
||||||
.PHONY: bootstrap-clean
|
.PHONY: bootstrap-clean
|
||||||
bootstrap-clean: host-bootstrap-clean
|
bootstrap-clean: gate-bootstrap-clean host-bootstrap-clean
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -37,11 +37,46 @@ LAN_GATE=SKIP
|
|||||||
|
|
||||||
REBOOT=${REBOOT:=1}
|
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 gate's WAN bridge to vmbr${WAN_BRIDGE}..."
|
||||||
|
@ sed -i \
|
||||||
|
-e 's/^\(net0.*vmbr\)'${ADMIN_BRIDGE}'/\1'${WAN_BRIDGE}'/' \
|
||||||
|
/etc/pve/lxc/${ID}.conf
|
||||||
|
exit
|
||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
readVars
|
readVars
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
# XXX add interface bootstrap...
|
# XXX add interface bootstrap...
|
||||||
INTERFACES=(
|
INTERFACES=(
|
||||||
"name=wan,bridge=vmbr${WAN_BRIDGE},firewall=1${WAN_GATE:+,gw=${WAN_GATE}}${WAN_IP:+,ip=${WAN_IP}},type=veth"
|
"name=wan,bridge=vmbr${WAN_BRIDGE},firewall=1${WAN_GATE:+,gw=${WAN_GATE}}${WAN_IP:+,ip=${WAN_IP}},type=veth"
|
||||||
|
|||||||
23
host/make.sh
23
host/make.sh
@ -35,12 +35,35 @@ SOFTWARE=(
|
|||||||
tmux
|
tmux
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# XXX
|
||||||
|
#BRIDGES_TPL=bridges.tpl
|
||||||
BRIDGES_TPL=bootstrap-bridges.tpl
|
BRIDGES_TPL=bootstrap-bridges.tpl
|
||||||
|
|
||||||
# XXX
|
# XXX
|
||||||
#readVars
|
#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
|
# Tools
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user