Skip to content

Instantly share code, notes, and snippets.

@danawesome
Last active April 13, 2025 10:34
Show Gist options
  • Select an option

  • Save danawesome/03b54b34455b598339962a1221e0b5c3 to your computer and use it in GitHub Desktop.

Select an option

Save danawesome/03b54b34455b598339962a1221e0b5c3 to your computer and use it in GitHub Desktop.
Zorin OS 17 remove enhanced session xrdp
#!/bin/bash
if [ "$(id -u)" -ne 0 ]; then
echo 'This script must be run with root privileges' >&2
exit 1
fi
if [ -f /var/run/reboot-required ]; then
echo "A reboot is required in order to proceed with the install." >&2
echo "Please reboot and re-run this script to finish the install." >&2
exit 1
fi
echo "Remove Custom Zorin XRDP install"
echo "Starting removal..."
echo "systemctl stop xrdp"
systemctl stop xrdp
echo "systemctl stop xrdp-sesman"
systemctl stop xrdp-sesman
echo "apt remove -y xrdp"
apt remove -y xrdp
echo "rm -r /etc/X11/xrdp"
rm -r /etc/X11/xrdp
echo "rm /etc/modprobe.d/blacklist_vmw_vsock_vmci_transport.conf"
rm /etc/modprobe.d/blacklist_vmw_vsock_vmci_transport.conf
echo "rm /etc/modules-load.d/hv_sock.conf"
rm /etc/modules-load.d/hv_sock.conf
echo "rm /etc/polkit-1/localauthority/50-local.d/45-allow-colord.pkla"
rm /etc/polkit-1/localauthority/50-local.d/45-allow-colord.pkla
echo "systemctl daemon-reload"
systemctl daemon-reload
echo "rm -r /etc/xrdp"
rm -r /etc/xrdp
echo "Clean up unneeded packages"
apt autoremove
echo "Removal is complete."
echo "Reboot your machine"
#################################
rebooting_maybe ()
{
local PS3='Confirm system reboot [y]/n: '
local TMOUT=10
local do_reboot=true
while true; do
if ! read -p "$PS3"; then
# timeout
break
fi
case $REPLY in
[yY]*)
# default case
break ;;
[nN]*)
do_reboot=false
break ;;
*)
echo 'Sorry, try again' >&2
esac
done
if "$do_reboot"; then
echo 'Rebooting...'
systemctl reboot now
else
echo 'Will not reboot'
fi
}
rebooting_maybe()
@danawesome
Copy link
Author

Clean up and adding echo's to help user know what is happening

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment