diff --git a/scripts/rustdesk-client-local.service b/scripts/rustdesk-client-local.service new file mode 100644 index 0000000..df17376 --- /dev/null +++ b/scripts/rustdesk-client-local.service @@ -0,0 +1,17 @@ +[Unit] +Description=RustDesk Client (local hbbs) +After=xorg-dummy.service network.target + +[Service] +Type=simple +User=root +Environment="DISPLAY=:0" +Environment="XAUTHORITY=/root/.Xauthority" +ExecStartPre=/root/write-rustdesk-config.sh +ExecStartPre=/bin/sleep 2 +ExecStart=/usr/share/rustdesk/rustdesk --server +Restart=always +RestartSec=10 + +[Install] +WantedBy=multi-user.target diff --git a/scripts/write-rustdesk-config.sh b/scripts/write-rustdesk-config.sh new file mode 100755 index 0000000..fe9d215 --- /dev/null +++ b/scripts/write-rustdesk-config.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -e +CONFIG="/root/.config/rustdesk/RustDesk2.toml" + +printf "%s\n" \ + "rendezvous_server = 'localhost:21116'" \ + "custom-rendezvous-server = 'localhost:21116'" \ + "key = 'JDSXd9sxN6Y7mIzu3krSpPTTc4yjChfqpzgIH5fl9Iw='" \ + "nat_type = 1" \ + "serial = 0" \ + "unlock_pin = ''" \ + "" \ + "[options]" \ + "local-ip-addr = '2.59.219.61'" \ + > "$CONFIG" + +chmod 600 "$CONFIG" +echo "Config written to $CONFIG"