-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxrdp.sh
53 lines (32 loc) · 1.11 KB
/
xrdp.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
linux_man='[email protected]'
os_release=`cat /etc/os-release|grep '^NAME'|awk -F'"' '{print $2}'`
version=`cat /etc/os-release|grep '^VERSION='|awk -F'"' '{print $2}'`
if [ "$os_release" = "Ubuntu" ];then
apt-get update
apt-get -y install ubuntu-desktop
sed -i 's/console/anybody/g' /etc/X11/Xwrapper.conf
apt-get -y install xrdp xorgxrdp
result=$?
apt-get install -y gnome-shell-extension-dashtodock unity gnome-tweaks gnome-tweak-tool
# to stop the pop up for xrdp
rm /usr/share/polkit-1/actions/org.freedesktop.color.policy
if [ $result != 0 ];then
mail -s "xrdp install failed for `hostname`" $linux_man
exit
fi
fi
if [ "$os_release" = "CentOS Linux" ];then
yum install -y epel-release
yum makecache fast
yum groupinstall "X Window System" "GNOME Desktop" -y
systemctl set-default graphical.target
yum install -y xrdp
dbus-daemon --system
systemctl enable xrdp xrdp-sesman && systemctl start xrdp xrdp-sesman
result=$?
if [ $result != 0 ];then
mail -s "xrdp install failed for `hostname`" $linux_man
exit
fi
fi