From 3487a3c058b6577d8d7c200aaa37cf804a521dfd Mon Sep 17 00:00:00 2001 From: Mattia Date: Tue, 9 Feb 2021 09:42:34 +0100 Subject: [PATCH 1/2] Replace hard-coded guest name (RDPWindows) with the config variable 'RDP_NAME' --- bin/winapps | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/winapps b/bin/winapps index 6cedf12..8e7804f 100755 --- a/bin/winapps +++ b/bin/winapps @@ -54,12 +54,12 @@ if [ -z "${RDP_IP}" ]; then echo ' sudo usermod -a -G kvm $(whoami)' exit fi - if [ -z "$(virsh list |grep RDPWindows)" ]; then + if [ -z "$(virsh list |grep ${RDP_NAME})" ]; then echo "RDPWindows is not running, run:" - echo " virsh start RDPWindows" + echo " virsh start ${RDP_NAME}" exit fi - RDP_IP=$(virsh net-dhcp-leases default |grep RDPWindows |awk '{print $5}') + RDP_IP=$(virsh net-dhcp-leases default |grep "${RDP_NAME}" |awk '{print $5}') RDP_IP=${RDP_IP%%\/*} fi From a82bc8fec43700e229c00186ee5407e2d3869cc8 Mon Sep 17 00:00:00 2001 From: Mattia Date: Tue, 9 Feb 2021 09:44:31 +0100 Subject: [PATCH 2/2] Use the default name ('RDPWindows') if RDP_NAME is not set --- bin/winapps | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/winapps b/bin/winapps index 8e7804f..a4e16b3 100755 --- a/bin/winapps +++ b/bin/winapps @@ -47,6 +47,10 @@ if [ -z "$(which xfreerdp)" ]; then exit fi +if [ -z "${RDP_NAME}" ]; then + RDP_NAME="RDPWindows" +fi + if [ -z "${RDP_IP}" ]; then if [ -z "$(groups |grep libvirt)" ]; then echo "You are not a member of the libvirt group. Run the below then reboot."