aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2024-06-19 15:40:11 -0300
committerSilvio Rhatto <rhatto@riseup.net>2024-06-19 15:40:11 -0300
commit57e111c5eb6fa30c0f0a759fb14b6a1d97d5e2a4 (patch)
treeca94016deb9abcef5503cd1d7bd1d19f26719abf
parentd75a748507597604e1fd7d6d03f1959ecc338bc1 (diff)
downloadkvmx-57e111c5eb6fa30c0f0a759fb14b6a1d97d5e2a4.tar.gz
kvmx-57e111c5eb6fa30c0f0a759fb14b6a1d97d5e2a4.tar.bz2
Fix: provide default parameters by loading the sample config
-rw-r--r--ChangeLog.md5
-rwxr-xr-xkvmx17
-rw-r--r--kvmxfile10
3 files changed, 20 insertions, 12 deletions
diff --git a/ChangeLog.md b/ChangeLog.md
index e7e4283..d2062bd 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,5 +1,10 @@
# ChangeLog
+## 0.1.1 - unreleased
+
+* Provide default parameters by loading the sample config.
+ This allows a `kvmxfile` to be small and have only the overrides.
+
## 0.1.0 - 2024-05-17
* This software started on 2017-03-09, but only now it's getting an initial
diff --git a/kvmx b/kvmx
index 2afc9b3..214f560 100755
--- a/kvmx
+++ b/kvmx
@@ -19,7 +19,7 @@
#
# Basic parameters
-VERSION="0.1.0"
+VERSION="0.1.1"
BASENAME="`basename $0`"
DIRNAME="`dirname $0`"
ACTION="$1"
@@ -122,17 +122,20 @@ function __kvmx_initialize {
GUEST_DISPLAY="$(((RANDOM % 10) + 1))"
XDMCP_PORT="$(($RANDOM + 10000))"
+ # Load the default config, providing defaults
+ source $APP_BASE/kvmxfile || exit 1
+
+ # Set hostname (this is already done with the default config)
+ #hostname="${hostname:-$VM}"
+
+ # Set domain (this is already done with the default config)
+ #domain="${domain:-example.org}"
+
# Load user config
if [ -e "$GLOBAL_USER_CONFIG_FILE" ]; then
source $GLOBAL_USER_CONFIG_FILE
fi
- # Set hostname
- hostname="${hostname:-$VM}"
-
- # Set domain
- domain="${domain:-example.org}"
-
# Load and check guest config
if [ "$ACTION" != "ls" ] && [ "$ACTION" != "edit" ] && [ "$ACTION" != "usage" ]; then
if [ ! -e "$GLOBAL_USER_CONFIG_FOLDER/$VM" ]; then
diff --git a/kvmxfile b/kvmxfile
index 191b160..ab698cf 100644
--- a/kvmxfile
+++ b/kvmxfile
@@ -30,8 +30,8 @@ net="user"
# Set this is you want to be able to share a single folder between host and guest.
# Needs ssh_support set to "y" and a workable SSH connection to the guest.
-shared_folder="."
-shared_folder_mountpoint="/home/$user/code/$VM"
+#shared_folder="."
+#shared_folder_mountpoint="/home/$user/code/$VM"
#shared_folder="$HOME/temp/shared/$VM"
#shared_folder_mountpoint="/home/$user/temp/shared/$VM"
#shared_folder_mountpoint="/srv/shared"
@@ -105,10 +105,10 @@ graphics="-vga qxl"
vnc_client="virt-viewer"
# SPICE support
-spice="1"
+spice="0"
# Set this if you want to attach an spice client when the machine boots.
-run_spice_client="1"
+run_spice_client="0"
# SPICE client
#spice_client="remote-viewer"
@@ -116,7 +116,7 @@ run_spice_client="1"
spice_client="spicy"
# Set this if you want that kvmx-vdagent is triggered after the machine boots.
-kvmx_vdagent="1"
+kvmx_vdagent="0"
# Set this if you want to start an xpra session when the machine boots.
run_xpra="0"