From ddb0480f461c433ba0c05bccdb7b5702ce862885 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Fri, 26 Jan 2024 03:06:55 +0300 Subject: [PATCH] added post-setup notes to each ct... Signed-off-by: Alex A. Naanou --- .pct-helpers | 22 ++++++++++++++++++++++ gate-traefik/make.sh | 1 + gitea/make.sh | 1 + host/make.sh | 2 ++ nextcloud/make.sh | 1 + ns/make.sh | 1 + reserve/make.sh | 1 + ssh/make.sh | 1 + syncthing/make.sh | 1 + wireguard/make.sh | 1 + 10 files changed, 32 insertions(+) diff --git a/.pct-helpers b/.pct-helpers index 256e2ad..decfd83 100644 --- a/.pct-helpers +++ b/.pct-helpers @@ -818,6 +818,28 @@ pctSetNotes(){ } +# +# showNotes [VAR ...] +# +BUILD_NOTES=BUILD_NOTES +showNotes(){ + [ -e "${BUILD_NOTES}" ] \ + && mv "${BUILD_NOTES}"{,.bak} + [ -e "${BUILD_NOTES}".tpl ] \ + && cat "${BUILD_NOTES}".tpl \ + | expandPCTTemplate $@ \ + | tee "${BUILD_NOTES}" +} + +# +# pushNotes ID +# +pushNotes(){ + [ -e "${BUILD_NOTES}" ] \ + && @ pct-push-r $1 "${BUILD_NOTES}" +} + + #---------------------------------------------------------------------- # vim:set ts=4 sw=4 nowrap : diff --git a/gate-traefik/make.sh b/gate-traefik/make.sh index dc48ed8..bb41b2c 100755 --- a/gate-traefik/make.sh +++ b/gate-traefik/make.sh @@ -88,6 +88,7 @@ pctSetNotes $ID saveLastRunConfig +showNotes echo "# Done." diff --git a/gitea/make.sh b/gitea/make.sh index 53f3632..36cff13 100644 --- a/gitea/make.sh +++ b/gitea/make.sh @@ -78,6 +78,7 @@ pctSetNotes $ID saveLastRunConfig +showNotes echo "# Done." diff --git a/host/make.sh b/host/make.sh index f77e6b2..cc09ac1 100644 --- a/host/make.sh +++ b/host/make.sh @@ -46,6 +46,8 @@ if xreadYes "# Update firewall rules?" FIREWALL ; then @ cp --backup -i templates/etc/pve/firewall/cluster.fw /etc/pve/firewall/ fi +showNotes +echo "# Done." diff --git a/nextcloud/make.sh b/nextcloud/make.sh index c2da9d9..00af37a 100755 --- a/nextcloud/make.sh +++ b/nextcloud/make.sh @@ -141,6 +141,7 @@ pctSetNotes $ID saveLastRunConfig +showNotes echo "# Done." diff --git a/ns/make.sh b/ns/make.sh index 62cd55b..770cfba 100755 --- a/ns/make.sh +++ b/ns/make.sh @@ -78,6 +78,7 @@ pctSetNotes $ID saveLastRunConfig +showNotes echo "# Done." diff --git a/reserve/make.sh b/reserve/make.sh index 1bfac46..b435a25 100644 --- a/reserve/make.sh +++ b/reserve/make.sh @@ -77,6 +77,7 @@ makeReserveCT $NS_ID $RESERVE_NS_ID $TEMPLATE_NS_ID saveLastRunConfig +showNotes echo "# Done." diff --git a/ssh/make.sh b/ssh/make.sh index 72f8eb6..6a31da4 100755 --- a/ssh/make.sh +++ b/ssh/make.sh @@ -89,6 +89,7 @@ pctSetNotes $ID saveLastRunConfig +showNotes echo "# Done." diff --git a/syncthing/make.sh b/syncthing/make.sh index 881c4b0..b591161 100755 --- a/syncthing/make.sh +++ b/syncthing/make.sh @@ -87,6 +87,7 @@ pctSetNotes $ID saveLastRunConfig +showNotes echo "# Done." diff --git a/wireguard/make.sh b/wireguard/make.sh index 65f9acc..abe3a2f 100755 --- a/wireguard/make.sh +++ b/wireguard/make.sh @@ -105,6 +105,7 @@ pctSetNotes $ID saveLastRunConfig +showNotes echo "# Done."