diff --git a/.pct-helpers b/.pct-helpers index 1b5f203..eef57cd 100644 --- a/.pct-helpers +++ b/.pct-helpers @@ -213,6 +213,11 @@ readVars(){ xread "ID: " ID xread "Hostname: " CTHOSTNAME + # hardware... + xread "RAM (MB): " RAM + xread "SWAP (MB): " SWAP + xread "DRIVE (GB): " DRIVE + # bridge config... xread "WAN bridge: vmbr" WAN_BRIDGE xread "LAN bridge: vmbr" LAN_BRIDGE diff --git a/gate-traefik/make.sh b/gate-traefik/make.sh index a7f1402..18040dc 100755 --- a/gate-traefik/make.sh +++ b/gate-traefik/make.sh @@ -24,6 +24,10 @@ source ../.pct-helpers DFL_ID=${DFL_ID:=101} DFL_CTHOSTNAME=${GATE_HOSTNAME:=${DFL_CTHOSTNAME:=gate}} +RAM=128 +SWAP=$RAM +DRIVE=0.5 + DFL_WAN_IP=${DFL_WAN_IP} DFL_WAN_GATE=${DFL_WAN_GATE} @@ -41,13 +45,13 @@ readVars OPTS_STAGE_1="\ --hostname $CTHOSTNAME \ - --memory 128 \ - --swap 128 \ + --memory $RAM \ + --swap $SWAP \ --net0 name=wan,bridge=vmbr${WAN_BRIDGE},firewall=1${WAN_GATE:+,gw=${WAN_GATE}}${WAN_IP:+,ip=${WAN_IP}},type=veth \ --net1 name=admin,bridge=vmbr${ADMIN_BRIDGE},firewall=1${ADMIN_IP:+,ip=${ADMIN_IP}},type=veth \ --net2 name=lan,bridge=vmbr${LAN_BRIDGE},firewall=1${LAN_IP:+,ip=${LAN_IP}},type=veth \ --storage local-lvm \ - --rootfs local-lvm:0.5 \ + --rootfs local-lvm:$DRIVE \ --unprivileged 1 \ ${PCT_EXTRA} \ " diff --git a/ns/make.sh b/ns/make.sh index d55c806..74d3205 100755 --- a/ns/make.sh +++ b/ns/make.sh @@ -24,6 +24,10 @@ source ../.pct-helpers DFL_ID=${DFL_ID:=100} DFL_CTHOSTNAME=${NS_HOSTNAME:=${DFL_CTHOSTNAME:=ns}} +RAM=128 +SWAP=$RAM +DRIVE=0.5 + WAN_IP=- WAN_GATE=- DFL_ADMIN_IP=${DFL_ADMIN_IP:=10.0.0.1/24} @@ -41,12 +45,12 @@ readVars OPTS_STAGE_1="\ --hostname $CTHOSTNAME \ - --memory 128 \ - --swap 128 \ + --memory $RAM \ + --swap $SWAP \ --net0 name=lan,bridge=vmbr0,firewall=1${LAN_GATE:+,gw=$LAN_GATE}${LAN_IP:+,ip=$LAN_IP},type=veth \ --net1 name=admin,bridge=vmbr1,firewall=1${ADMIN_IP:+,ip=$ADMIN_IP},type=veth \ --storage local-lvm \ - --rootfs local-lvm:0.5 \ + --rootfs local-lvm:$DRIVE \ --unprivileged 1 \ ${PCT_EXTRA} \ " diff --git a/syncthing/make.sh b/syncthing/make.sh index b0af81c..015c529 100644 --- a/syncthing/make.sh +++ b/syncthing/make.sh @@ -21,8 +21,12 @@ source ../.pct-helpers #---------------------------------------------------------------------- -DFL_ID=${DFL_ID:=100} -DFL_CTHOSTNAME=${NS_HOSTNAME:=${DFL_CTHOSTNAME:=ns}} +DFL_ID=${DFL_ID:=301} +DFL_CTHOSTNAME=${NS_HOSTNAME:=${DFL_CTHOSTNAME:=syncthing}} + +DFL_RAM=${RAM:=${DFL_RAM:=1024}} +DFL_SWAP=${SWAP:=${DFL_SWAP:=$RAM}} +DFL_DRIVE=${DRIVE:=${DFL_DRIVE:=8}} WAN_IP=- WAN_GATE=- @@ -40,12 +44,12 @@ readVars OPTS_STAGE_1="\ --hostname $CTHOSTNAME \ - --memory 512 \ - --swap 512 \ + --memory $RAM \ + --swap $SWAP \ --net0 name=lan,bridge=vmbr0,firewall=1,ip=dhcp,type=veth \ --net1 name=admin,bridge=vmbr1,firewall=1,ip=dhcp,type=veth \ --storage local-lvm \ - --rootfs local-lvm:0.5 \ + --rootfs local-lvm:$DRIVE \ --unprivileged 1 \ ${PCT_EXTRA} \ "