diff --git a/bin/winapps b/bin/winapps index 6cedf12..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." @@ -54,12 +58,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