diff --git a/.pct-helpers b/.pct-helpers index 9c3e311..3ca3e09 100644 --- a/.pct-helpers +++ b/.pct-helpers @@ -148,6 +148,8 @@ normpath(){ # https://pve.proxmox.com/wiki/Linux_Container getLatestTemplate(){ #IFS=$'\n' + @ pveam update + local templates=($(pveam available | grep -o ''${1}'.*$')) local latest=${templates[-1]} @@ -243,6 +245,7 @@ readVars(){ xread "Hostname: " CTHOSTNAME # hardware... + xread "CPU cores: " CORES xread "RAM (MB): " RAM xread "SWAP (MB): " SWAP xread "DRIVE (GB): " DRIVE diff --git a/gate-traefik/make.sh b/gate-traefik/make.sh index 4a6d87d..69c2503 100755 --- a/gate-traefik/make.sh +++ b/gate-traefik/make.sh @@ -20,6 +20,7 @@ readConfig DFL_ID=${DFL_ID:=101} DFL_CTHOSTNAME=${GATE_HOSTNAME:=${DFL_CTHOSTNAME:=gate}} +CORES=1 RAM=128 SWAP=$RAM DRIVE=0.5 @@ -41,6 +42,7 @@ readVars OPTS_STAGE_1="\ --hostname $CTHOSTNAME \ + --cores $CORES \ --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 \ diff --git a/nextcloud/make.sh b/nextcloud/make.sh index 827bcb5..9cbb907 100755 --- a/nextcloud/make.sh +++ b/nextcloud/make.sh @@ -20,6 +20,7 @@ readConfig DFL_ID=${DFL_ID:=300} DFL_CTHOSTNAME=${DFL_CTHOSTNAME:=nextcloud} +DFL_CORES=${DFL_CORES:=2} DFL_RAM=${DFL_RAM:=2048} DFL_SWAP=${DFL_SWAP:=${DFL_RAM:=2048}} DFL_DRIVE=${DFL_DRIVE:=40} @@ -40,8 +41,8 @@ readVars # XXX cores... OPTS_STAGE_1="\ - --cores 2 \ --hostname $CTHOSTNAME \ + --cores $CORES \ --memory $RAM \ --swap $SWAP \ --net0 name=lan,bridge=vmbr${LAN_BRIDGE},firewall=1,ip=dhcp,type=veth \ @@ -65,6 +66,7 @@ buildAssets "$TEMPLATE_DIR" "$ASSETS_DIR" echo "# Creating CT..." getLatestTemplate '.*-turnkey-nextcloud' TEMPLATE pctCreate $ID "$TEMPLATE" "$OPTS_STAGE_1" "$PASS" +sleep ${TIMEOUT:=5} echo "# Starting TKL Setup (this may take a few minutes to start)..." @ lxc-attach $ID -- bash --login -c exit diff --git a/ns/make.sh b/ns/make.sh index 746ebc0..8500e64 100755 --- a/ns/make.sh +++ b/ns/make.sh @@ -20,6 +20,7 @@ readConfig DFL_ID=${DFL_ID:=100} DFL_CTHOSTNAME=${NS_HOSTNAME:=${DFL_CTHOSTNAME:=ns}} +CORES=1 RAM=128 SWAP=$RAM DRIVE=0.5 @@ -41,6 +42,7 @@ readVars OPTS_STAGE_1="\ --hostname $CTHOSTNAME \ + --cores $CORES \ --memory $RAM \ --swap $SWAP \ --net0 name=lan,bridge=vmbr${LAN_BRIDGE},firewall=1${LAN_GATE:+,gw=$LAN_GATE}${LAN_IP:+,ip=$LAN_IP},type=veth \ diff --git a/ssh/make.sh b/ssh/make.sh index 0723588..76e332f 100755 --- a/ssh/make.sh +++ b/ssh/make.sh @@ -20,6 +20,7 @@ readConfig DFL_ID=${DFL_ID:=102} DFL_CTHOSTNAME=${DFL_CTHOSTNAME:=ssh} +DFL_CORES=${DFL_CORES:=1} DFL_RAM=${DFL_RAM:=1024} DFL_SWAP=${DFL_SWAP:=${DFL_RAM:=1024}} DFL_DRIVE=${DFL_DRIVE:=16} @@ -41,6 +42,7 @@ readVars OPTS_STAGE_1="\ --hostname $CTHOSTNAME \ + --cores $CORES \ --memory $RAM \ --swap $SWAP \ --net0 name=lan,bridge=vmbr${LAN_BRIDGE},firewall=1,ip=dhcp,type=veth \ diff --git a/syncthing/make.sh b/syncthing/make.sh index dc3e471..41be0fb 100755 --- a/syncthing/make.sh +++ b/syncthing/make.sh @@ -20,6 +20,7 @@ readConfig DFL_ID=${DFL_ID:=301} DFL_CTHOSTNAME=${DFL_CTHOSTNAME:=syncthing} +DFL_CORES=${DFL_CORES:=1} DFL_RAM=${DFL_RAM:=1024} DFL_SWAP=${DFL_SWAP:=${DFL_RAM:=1024}} DFL_DRIVE=${DFL_DRIVE:=8} @@ -40,6 +41,7 @@ readVars OPTS_STAGE_1="\ --hostname $CTHOSTNAME \ + --cores $CORES \ --memory $RAM \ --swap $SWAP \ --net0 name=lan,bridge=vmbr${LAN_BRIDGE},firewall=1,ip=dhcp,type=veth \