Output configs to /tmp/
This commit is contained in:
parent
0bbaed4d3f
commit
7533f37c46
1 changed files with 21 additions and 8 deletions
29
start
29
start
|
@ -55,33 +55,46 @@ base_path=base
|
|||
default_path=default
|
||||
hardware_path=hardware
|
||||
specific_path="$VMNAME"
|
||||
|
||||
o_base_path="$(mktemp)"
|
||||
o_default_path="$(mktemp)"
|
||||
o_hardware_path="$(mktemp)"
|
||||
o_specific_path="$(mktemp)"
|
||||
if [[ -e "$base_path.conf.tmpl" ]]; then
|
||||
(
|
||||
# shellcheck disable=SC1090
|
||||
[[ -e "$base_path.sh" ]] && source "$base_path.sh"
|
||||
envsubst < "$base_path.conf.tmpl" > "$base_path.conf"
|
||||
envsubst < "$base_path.conf.tmpl" > "$o_base_path"
|
||||
)
|
||||
else
|
||||
cp "$base_path.conf" "$o_base_path"
|
||||
fi
|
||||
if [[ -e "$default_path.conf.tmpl" ]]; then
|
||||
(
|
||||
# shellcheck disable=SC1090
|
||||
[[ -e "$default_path.sh" ]] && source "$default_path.sh"
|
||||
envsubst < "$default_path.conf.tmpl" > "$default_path.conf"
|
||||
envsubst < "$default_path.conf.tmpl" > "$o_default_path"
|
||||
)
|
||||
else
|
||||
cp "$default_path.conf" "$o_default_path"
|
||||
fi
|
||||
if [[ -e "$hardware_path.conf.tmpl" ]]; then
|
||||
(
|
||||
# shellcheck disable=SC1090
|
||||
[[ -e "$hardware_path.sh" ]] && source "$hardware_path.sh"
|
||||
envsubst < "$hardware_path.conf.tmpl" > "$hardware_path.conf"
|
||||
envsubst < "$hardware_path.conf.tmpl" > "$o_hardware_path"
|
||||
)
|
||||
else
|
||||
cp "$hardware_path.conf" "$o_hardware_path"
|
||||
fi
|
||||
if [[ -e "$specific_path.conf.tmpl" ]]; then
|
||||
(
|
||||
# shellcheck disable=SC1090
|
||||
[[ -e "$specific_path.sh" ]] && source "$specific_path.sh"
|
||||
envsubst < "$specific_path.conf.tmpl" > "$specific_path.conf"
|
||||
envsubst < "$specific_path.conf.tmpl" > "$o_specific_path"
|
||||
)
|
||||
else
|
||||
cp "$specific_path.conf" "$o_specific_path"
|
||||
fi
|
||||
|
||||
if [[ -e "pre-start.sh" ]]; then
|
||||
|
@ -98,10 +111,10 @@ default_arguments=()
|
|||
hardware_arguments=()
|
||||
specific_arguments=()
|
||||
# mask EOF
|
||||
read -ra base_arguments -d '' < "$base_path.conf" || true
|
||||
read -ra default_arguments -d '' < "$default_path.conf" || true
|
||||
read -ra hardware_arguments -d '' < "$hardware_path.conf" || true
|
||||
read -ra specific_arguments -d '' < "$specific_path.conf" || true
|
||||
read -ra base_arguments -d '' < "$o_base_path" || true
|
||||
read -ra default_arguments -d '' < "$o_default_path" || true
|
||||
read -ra hardware_arguments -d '' < "$o_hardware_path" || true
|
||||
read -ra specific_arguments -d '' < "$o_specific_path" || true
|
||||
$DEBUG $SUDO nice --adjustment=-20 taskset --cpu-list '1-5,7-11' \
|
||||
qemu-system-x86_64 \
|
||||
-name "$VMNAME,process=VMNAME" \
|
||||
|
|
Loading…
Add table
Reference in a new issue