From 5282959b9b16210fbe7baf482b178c7fd296f3c9 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 3 Jan 2024 20:13:51 +0300 Subject: [PATCH] tweaking... Signed-off-by: Alex A. Naanou --- .pct-helpers | 19 +++++++++++++++---- Makefile | 4 ++-- gate-traefik/make.sh | 8 ++++++-- ns/make.sh | 6 ++++++ 4 files changed, 29 insertions(+), 8 deletions(-) diff --git a/.pct-helpers b/.pct-helpers index 5336623..403e636 100644 --- a/.pct-helpers +++ b/.pct-helpers @@ -160,6 +160,8 @@ xread(){ } +# +# readVars # # Variables this handles: # EMAIL @@ -233,7 +235,9 @@ readVars(){ } -# buildAssets [TEMPLATES [ASSETS]] +# +# buildAssets [TEMPLATES [ASSETS]] +# buildAssets(){ local TEMPLATE_DIR=$1 TEMPLATE_DIR=${TEMPLATE_DIR:=templates} @@ -264,7 +268,9 @@ buildAssets(){ } -# pctCreate ID TEMPLATE ARGS [PASS] +# +# pctCreate ID TEMPLATE ARGS [PASS] +# pctCreate(){ local TMP_PASS=$(cat /dev/urandom | base64 | head -c ${TMP_PASS_LEN:=32}) # NOTE: we are not setting the password here to avoid printing it to the terminal... @@ -281,13 +287,16 @@ pctCreate(){ fi } -# pctCreate ID ARGS [PASS] +# +# pctCreate ID ARGS [PASS] +# pctCreateAlpine(){ if [ $DRY_RUN ] ; then local TEMPLATE=(/var/lib/vz/template/cache/alpine-3.18\*.tar.xz) else local TEMPLATE=($(ls /var/lib/vz/template/cache/alpine-3.18*.tar.xz)) fi + pctCreate $1 "${TEMPLATE[-1]}" "$2" "$3" @ lxc-attach $1 apk update @@ -295,7 +304,9 @@ pctCreateAlpine(){ } -# pctSet ID [ARGS [REBOOT]] +# +# pctSet ID [ARGS [REBOOT]] +# pctSet(){ [ "$2" ] \ && @ pct set $1 \ diff --git a/Makefile b/Makefile index 2f61cbb..3627a4b 100644 --- a/Makefile +++ b/Makefile @@ -9,11 +9,11 @@ config: config.global gate: gate-traefik - cd $< && ./make.sh + $