#!/bin/bash
set -euo pipefail
APP="/Applications/RustDesk.app/Contents/MacOS/RustDesk"
if [ ! -x "$APP" ]; then
  osascript -e 'display dialog "Please install the official RustDesk app from the RustDesk website (drag it into Applications), then run this setup again." buttons {"OK"} default button "OK"' || true
  exit 1
fi
printf 'Configuring RustDesk to use Yellow Dog remote support...\n'
"$APP" --config '=0nI9EkbsJDMXVVbRhzULplNk1EdPhEUiZEeohlQTR0buxUWDFEStFVMrUkb2olI6ISeltmIsIiI6ISawFmIsIiI6ISehxWZyJCLi02bj5SbpRWeus2clRGdzVnciojI0N3boJye'
printf '\nConfiguration command completed. Open RustDesk and check Settings > Network: ID Server should be rustdesk.ydim.com.\n'
open -a RustDesk
