Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace hard-coded PC name 'RDPWindows' with the config variable 'RDP_NAME' #178

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions bin/winapps
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,23 @@ 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."
echo ' sudo usermod -a -G libvirt $(whoami)'
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

Expand Down