mirror of
https://github.com/flynx/proxmox-utils.git
synced 2025-10-28 10:40:07 +00:00
preparing for per-ct configuration...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
bce1839e2e
commit
3b04382faf
12
.pct-helpers
12
.pct-helpers
@ -12,6 +12,8 @@ CT_DIR=${CT_DIR:=/etc/pve/lxc/}
|
||||
|
||||
EDITOR=${EDITOR:-nano}
|
||||
|
||||
LAST_RUN_CONFIG=config.last-run
|
||||
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
@ -406,9 +408,9 @@ readConfig(){
|
||||
[ -e ./config ] \
|
||||
&& source ./config
|
||||
# XXX is this the right priority for this???
|
||||
[ -e ./config.last-run ] \
|
||||
[ -e ./$LAST_RUN_CONFIG ] \
|
||||
&& [ -z $CLEAN_RUN ] \
|
||||
&& source ./config.last-run
|
||||
&& source ./$LAST_RUN_CONFIG
|
||||
[ -e "$CONFIG" ] \
|
||||
&& source $CONFIG
|
||||
#eval "${__ENV[@]}"
|
||||
@ -454,14 +456,16 @@ saveConfig(){
|
||||
|
||||
|
||||
saveLastRunConfig(){
|
||||
local cfg=config.last-run
|
||||
echo "# Saving config to: config.last-run"
|
||||
local cfg=$LAST_RUN_CONFIG
|
||||
local ct_cfg=$ID-$CTHOSTNAME.cfg
|
||||
echo "# Saving config to: $cfg and $ct_cfg"
|
||||
{
|
||||
echo "#"
|
||||
echo "# This file is auto-generated, any changes here will be overwritten."
|
||||
echo "#"
|
||||
} > "$cfg"
|
||||
saveConfig -d -a "$cfg" ${XREAD_VARS[@]}
|
||||
cp "$cfg" "$ct_cfg"
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user