Make rdp-test.sh package/binary name robust across FreeRDP versions
freerdp2-x11 assumed the FreeRDP 2.x package/binary naming, but newer Debian/Ubuntu releases have moved to a 3.x package where the binary may be xfreerdp3 instead of xfreerdp. Try both, and use whichever binary actually ends up available. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
1f111b78f3
commit
7281cfcbca
1 changed files with 15 additions and 3 deletions
18
rdp-test.sh
18
rdp-test.sh
|
|
@ -15,10 +15,22 @@ set -uo pipefail
|
|||
RDP_HOST="teemu-thinkpad-ubuntu.tail27b01.ts.net"
|
||||
RDP_USER="CHANGE_ME"
|
||||
|
||||
which xfreerdp >/dev/null 2>&1 || sudo apt install -y freerdp2-x11
|
||||
if ! command -v xfreerdp >/dev/null 2>&1 && ! command -v xfreerdp3 >/dev/null 2>&1; then
|
||||
sudo apt update
|
||||
sudo apt install -y freerdp2-x11 \
|
||||
|| sudo apt install -y freerdp3-x11 \
|
||||
|| sudo apt install -y freerdp-x11
|
||||
fi
|
||||
|
||||
echo "Connecting to $RDP_HOST as $RDP_USER ..."
|
||||
xfreerdp /v:"$RDP_HOST":3389 /u:"$RDP_USER" /cert:ignore 2>&1 | tee rdp-test-output.txt
|
||||
XFREERDP_BIN="$(command -v xfreerdp || command -v xfreerdp3)"
|
||||
if [ -z "$XFREERDP_BIN" ]; then
|
||||
echo "Still no xfreerdp/xfreerdp3 binary found after install attempts."
|
||||
echo "Run: apt-cache search freerdp - and tell Claude what it lists."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Connecting to $RDP_HOST as $RDP_USER (using $XFREERDP_BIN) ..."
|
||||
"$XFREERDP_BIN" /v:"$RDP_HOST":3389 /u:"$RDP_USER" /cert:ignore 2>&1 | tee rdp-test-output.txt
|
||||
|
||||
echo
|
||||
echo "Written to rdp-test-output.txt - git add/commit/push it."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue