Add pve RustDesk GA sync scripts for curl install

This commit is contained in:
alexveley
2026-06-24 01:46:39 -04:00
commit 0f8ba4fba1
3 changed files with 323 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
#!/bin/bash
# Install blair-sync-rustdesk-via-ga.sh from Gitea raw URL. Run on pve as root.
set -euo pipefail
BASE_URL="${BLAIR_SYNC_BASE_URL:-https://git.easygoingaming.com/Davoguha/blair-pve-sync-temp/raw/main}"
TARGET='/usr/local/sbin/blair-sync-rustdesk-via-ga.sh'
SHARE_COPY='/tank/blair-share/tools/golden/host/sync-rustdesk-via-guest-agent.sh'
CRON='/etc/cron.d/blair-rustdesk-sync'
LOG='/var/log/blair-rustdesk-sync.log'
echo "=== Download sync script ==="
curl -fsSL "$BASE_URL/blair-sync-rustdesk-via-ga.sh" -o "$TARGET"
chmod +x "$TARGET"
sed -i 's/\r$//' "$TARGET" 2>/dev/null || true
mkdir -p "$(dirname "$SHARE_COPY")"
cp -f "$TARGET" "$SHARE_COPY"
chmod +x "$SHARE_COPY"
echo "=== shebang check ==="
head -1 "$TARGET" | od -An -tx1
file "$TARGET"
echo "=== cron ==="
printf '%s\n' "*/5 * * * * root $TARGET >> $LOG 2>&1" > "$CRON"
chmod 644 "$CRON"
cat "$CRON"
echo "=== dry run ==="
"$TARGET" --dry-run
echo "=== live run ==="
"$TARGET"
echo "=== VM 230 description ==="
qm config 230 | grep ^description || true
echo "=== done ==="