Skip to content

Instantly share code, notes, and snippets.

@ststeiger
Created October 23, 2025 17:46
Show Gist options
  • Select an option

  • Save ststeiger/ed18d24f685b3f7147d6294573b10c8b to your computer and use it in GitHub Desktop.

Select an option

Save ststeiger/ed18d24f685b3f7147d6294573b10c8b to your computer and use it in GitHub Desktop.
XRDP - restart the clipboard
#!/usr/bin/env bash
#
# restart_xrdp.sh - Interactive restart for xrdp related services
#
echo "Select what to restart:"
echo "1) chansrv"
echo "2) xrdp"
echo "3) xrdp-sesman"
echo "4) xrdp + xrdp-sesman"
echo "5) all (chansrv + xrdp + xrdp-sesman)"
read -p "Enter choice [1-5]: " choice
case "$choice" in
1)
echo "Restarting chansrv..."
sudo pkill xrdp-chansrv
sudo /usr/sbin/xrdp-chansrv &
;;
2)
echo "Restarting xrdp service..."
sudo systemctl restart xrdp
;;
3)
echo "Restarting xrdp-sesman service..."
sudo systemctl restart xrdp-sesman
;;
4)
echo "Restarting xrdp and xrdp-sesman services..."
sudo systemctl restart xrdp xrdp-sesman
;;
5)
echo "Restarting chansrv, xrdp and xrdp-sesman..."
sudo pkill xrdp-chansrv
sudo /usr/sbin/xrdp-chansrv &
sudo systemctl restart xrdp xrdp-sesman
;;
*)
echo "Invalid choice. Exiting."
exit 1
;;
esac
echo "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment