mirror of
https://github.com/flynx/proxmox-utils.git
synced 2025-12-25 04:42:04 +00:00
Compare commits
6 Commits
3f0e00b821
...
9eda8afb6c
| Author | SHA1 | Date | |
|---|---|---|---|
| 9eda8afb6c | |||
| c898c0c874 | |||
| a0b7e2c9d1 | |||
| 83216179de | |||
| 4f00b91d55 | |||
| c880780e48 |
33
.pct-helpers
33
.pct-helpers
@ -371,6 +371,8 @@ webAppConfig(){
|
||||
|
||||
#
|
||||
# readVars
|
||||
# readCTHardwareVars
|
||||
# readBridgeVars
|
||||
#
|
||||
# Variables this handles:
|
||||
# EMAIL
|
||||
@ -396,22 +398,28 @@ webAppConfig(){
|
||||
# TMP_PASS_LEN
|
||||
# ROOTPASS
|
||||
#
|
||||
readCTHardwareVars(){
|
||||
# hardware...
|
||||
xread "CPU cores: " CORES
|
||||
xread "RAM (MB): " RAM
|
||||
xread "SWAP (MB): " SWAP
|
||||
xread "DRIVE (GB): " DRIVE
|
||||
}
|
||||
readBridgeVars(){
|
||||
# bridge config...
|
||||
xread "WAN bridge: vmbr" WAN_BRIDGE
|
||||
xread "LAN bridge: vmbr" LAN_BRIDGE
|
||||
xread "ADMIN bridge: vmbr" ADMIN_BRIDGE
|
||||
}
|
||||
readVars(){
|
||||
xread -n "Email: " EMAIL
|
||||
xread -n "Domain: " DOMAIN
|
||||
xread "ID: " ID
|
||||
xread "Hostname: " CTHOSTNAME
|
||||
|
||||
# hardware...
|
||||
xread "CPU cores: " CORES
|
||||
xread "RAM (MB): " RAM
|
||||
xread "SWAP (MB): " SWAP
|
||||
xread "DRIVE (GB): " DRIVE
|
||||
readCTHardwareVars
|
||||
|
||||
# bridge config...
|
||||
xread "WAN bridge: vmbr" WAN_BRIDGE
|
||||
xread "LAN bridge: vmbr" LAN_BRIDGE
|
||||
xread "ADMIN bridge: vmbr" ADMIN_BRIDGE
|
||||
readBridgeVars
|
||||
|
||||
# gateway...
|
||||
# IPs can be:
|
||||
@ -473,10 +481,11 @@ PCT_TEMPLATE_VARS=(
|
||||
EMAIL
|
||||
DOMAIN
|
||||
CTHOSTNAME
|
||||
HOST_ADMIN_IP
|
||||
GATE_HOSTNAME
|
||||
NS_HOSTNAME
|
||||
GATE_LAN_IP
|
||||
GATE_ADMIN_IP
|
||||
NS_HOSTNAME
|
||||
NS_LAN_IP
|
||||
NS_ADMIN_IP
|
||||
WAN_IP
|
||||
@ -532,8 +541,8 @@ expandTemplate(){
|
||||
|
||||
|
||||
#
|
||||
# expandTemplate PATH [VAR ...]
|
||||
# .. | expandTemplate [VAR ...]
|
||||
# expandPCTTemplate PATH [VAR ...]
|
||||
# .. | expandPCTTemplate [VAR ...]
|
||||
#
|
||||
expandPCTTemplate(){
|
||||
local input=
|
||||
|
||||
@ -85,6 +85,9 @@ DFL_PCT_EXTRA=SKIP
|
||||
# can be left as-is.
|
||||
#
|
||||
|
||||
# host
|
||||
HOST_ADMIN_IP=10.0.0.245/24
|
||||
|
||||
# Nameserver
|
||||
NS_HOSTNAME=ns
|
||||
NS_ID=100
|
||||
|
||||
24
host/bridges.tpl
Normal file
24
host/bridges.tpl
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
auto vmbr${LAN_BRIDGE}
|
||||
iface vmbr${LAN_BRIDGE} inet manual
|
||||
bridge-ports none
|
||||
bridge-stp off
|
||||
bridge-fd 0
|
||||
#LAN
|
||||
|
||||
auto vmbr${WAN_BRIDGE}
|
||||
iface vmbr${WAN_BRIDGE} inet manual
|
||||
bridge-ports ${WAN_PORT}
|
||||
bridge-stp off
|
||||
bridge-fd 0
|
||||
#WAN
|
||||
|
||||
auto vmbr${ADMIN_BRIDGE}
|
||||
iface vmbr${ADMIN_BRIDGE} inet static
|
||||
address ${HOST_ADMIN_IP}
|
||||
gateway ${GATE_ADMIN_IPn}
|
||||
bridge-ports ${ADMIN_PORT}
|
||||
bridge-stp off
|
||||
bridge-fd 0
|
||||
#ADMIN
|
||||
|
||||
46
host/make.sh
46
host/make.sh
@ -10,12 +10,24 @@ PATH=$PATH:$(dirname "$(pwd)")
|
||||
source ../.pct-helpers
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
need ifreload
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
readConfig
|
||||
|
||||
|
||||
DFL_WAN_PORT=${DFL_WAN_PORT:-enp5s0}
|
||||
DFL_ADMIN_PORT=${DFL_ADMIN_PORT:-enp2s0}
|
||||
|
||||
DFL_HOST_ADMIN_IP=${PROXMOX_ADMIN_IP:-10.0.0.254/24}
|
||||
|
||||
|
||||
SOFTWARE=(
|
||||
ifupdown2
|
||||
make
|
||||
w3m links
|
||||
tree
|
||||
@ -25,6 +37,10 @@ SOFTWARE=(
|
||||
)
|
||||
|
||||
|
||||
# XXX
|
||||
#readVars
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
# Tools
|
||||
@ -37,8 +53,38 @@ if xreadYes "# Install additional apps?" APPS ; then
|
||||
fi
|
||||
|
||||
# Networking
|
||||
# XXX need to:
|
||||
# - bootstrap this
|
||||
# - setup the gate, ssh, and wireguard
|
||||
# - inalize
|
||||
# XXX /etc/hosts
|
||||
# XXX save config???
|
||||
# XXX should we do things in ./staging ???
|
||||
if xreadYes "# Create bridges?" BRIDGES ; then
|
||||
xread "WAN port: " WAN_PORT
|
||||
xread "ADMIN port: " ADMIN_PORT
|
||||
xread "Host ADMIN IP: " HOST_ADMIN_IP
|
||||
xread "Gate ADMIN IP: " GATE_ADMIN_IP
|
||||
readBridgeVars
|
||||
|
||||
@ cp /etc/network/interfaces{,.new}
|
||||
|
||||
BRIDGES="${\
|
||||
cat bridges.tpl \
|
||||
| expandPCTTemplate WAN_PORT ADMIN_PORT}"
|
||||
|
||||
# XXX add $BRIDGES to /etc/network/interfaces either before the
|
||||
# source command or at the end...
|
||||
# XXX
|
||||
|
||||
# review/apply setup...
|
||||
echo "# Review updated: /etc/network/interfaces.new:"
|
||||
@ cat /etc/network/interfaces.new
|
||||
echo
|
||||
if xreadYes "# Apply changes?" ; then
|
||||
@ mv -b /etc/network/interfaces{.new,}
|
||||
@ ifreload -a
|
||||
fi
|
||||
fi
|
||||
|
||||
# Firewall
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user