mirror of
https://github.com/flynx/proxmox-utils.git
synced 2025-12-18 17:41:47 +00:00
tweaking...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
01d57aa88a
commit
5282959b9b
11
.pct-helpers
11
.pct-helpers
@ -160,6 +160,8 @@ xread(){
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# readVars
|
||||
#
|
||||
# Variables this handles:
|
||||
# EMAIL
|
||||
@ -233,7 +235,9 @@ readVars(){
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# buildAssets [TEMPLATES [ASSETS]]
|
||||
#
|
||||
buildAssets(){
|
||||
local TEMPLATE_DIR=$1
|
||||
TEMPLATE_DIR=${TEMPLATE_DIR:=templates}
|
||||
@ -264,7 +268,9 @@ buildAssets(){
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# 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]
|
||||
#
|
||||
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(){
|
||||
[ "$2" ] \
|
||||
&& @ pct set $1 \
|
||||
|
||||
4
Makefile
4
Makefile
@ -9,11 +9,11 @@ config: config.global
|
||||
|
||||
|
||||
gate: gate-traefik
|
||||
cd $< && ./make.sh
|
||||
$</make.sh
|
||||
|
||||
|
||||
ns: ns
|
||||
cd $< && ./make.sh
|
||||
$</make.sh
|
||||
|
||||
|
||||
all: config gate ns
|
||||
|
||||
@ -1,11 +1,15 @@
|
||||
#!/usr/bin/bash
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
source ../.pct-helpers
|
||||
|
||||
cd $(dirname $0)
|
||||
PATH=$PATH:$(dirname "$(pwd)")
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
source ../.pct-helpers
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
[ -e ../config.global ] \
|
||||
|
||||
@ -1,6 +1,12 @@
|
||||
#!/usr/bin/bash
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
cd $(dirname $0)
|
||||
PATH=$PATH:$(dirname "$(pwd)")
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
source ../.pct-helpers
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user