summarylogtreecommitdiffstats
path: root/webex-teams-vdi.install
blob: 1ba3076615fb93248b6a1af578bb5e05757a4e5f (plain)
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
pre_install() {

	Citrix_PID=`pidof -s wfica`

	if [ $Citrix_PID ]; then
	    echo "============================================================================="
	    echo "                                                                             "
	    echo "Detected that Citrix Workspace is opened. You must close it and then reinstall........"
	    echo "                                                                             "
	    echo "============================================================================="
	    exit 1
	else
	    echo "Citrix Workspace is not running."

	fi

	TeamsVDI_PID=`pidof -s TeamsVDI`

	if [ $TeamsVDI_PID ]; then
	    echo "============================================================================="
	    echo "                                                                             "
	    echo "Detected that Teams VDI is opened and VMWare View may be open. You must close these and then reinstall........"
	    echo "                                                                             "
	    echo "============================================================================="
	    exit 1
	else
	    echo "TeamsVDI is not running."

	fi

}

post_install() {
	xdg-icon-resource forceupdate --theme hicolor &> /dev/null

	Citrix_PID=`pidof -s wfica`

	if [ $Citrix_PID ]; then
	    exit 1
	fi

	TeamsVDI_PID=`pidof -s TeamsVDI`

	if [ $TeamsVDI_PID ]; then
	    exit 1
	fi

	GNOME_ESTABLISHED=/tmp
	GNOME_ESTABLISHED=$GNOME_ESTABLISHED/gnome-session-established
	touch $GNOME_ESTABLISHED

	LIB_STDCXX=/opt/cisco/TeamsVDI/libstdc++.so.6
	if [ -f $LIB_STDCXX ]; then
	    rm -f /opt/cisco/TeamsVDI/libstdc++.so.6
	fi
	ln -s /opt/cisco/TeamsVDI/libstdc++.so.6.0.27 /opt/cisco/TeamsVDI/libstdc++.so.6
	sudo udevadm control --reload-rules

	THINPRO=`dpkg -l | grep thinpro-base | cut -d ' ' -f3`
	if [ $THINPRO ]; then
	    fsunlock
	fi

	if [ -z $THINPRO ]; then
	    test ! -d /opt/Citrix/ICAClient/ && mkdir -p /opt/Citrix/ICAClient/
	    ln -fs /usr/lib/ICAClient/libCiscoTeamsCitrixPlugin.so /opt/Citrix/ICAClient/libCiscoTeamsCitrixPlugin.so
	fi

	chmod 755 /opt/cisco/TeamsVDI/citrix-plugin-install.sh
	/opt/cisco/TeamsVDI/citrix-plugin-install.sh add Teams

	#collect telemetry data on Ubuntu - start
	echo CPU: | tr "\n" " " > /etc/TEAMSPlatformInfo.cisco
	grep -m 1 "model name" /proc/cpuinfo | cut -c 14- >> /etc/TEAMSPlatformInfo.cisco

	echo MEMORY: | tr "\n" " " >> /etc/TEAMSPlatformInfo.cisco
	var=$(dmidecode -t memory | grep '^[[:blank:]]Size:.*MB' | grep -v 'No Module' | cut -c 8 ) 2>>/etc/TEAMSInstallError.log
	sum=0
	num=$(echo "$var" | wc -l)
	i=1
	while [ $i -le $num ]; do
		tmp_var=`echo $var | cut -d ' ' -f$i`
		sum=$((sum + tmp_var)) 2>>/etc/TEAMSInstallError.log
		i=$((i + 1))	
	done
	echo $sum >> /etc/TEAMSPlatformInfo.cisco

	echo VXCVersion:  | tr "\n" " " >> /etc/TEAMSPlatformInfo.cisco
	vxme_version=$(cat /etc/build.teamsvdi.cisco ) 2>>/etc/TEAMSInstallError.log
	echo ${vxme_version} >> /etc/TEAMSPlatformInfo.cisco

	echo InstallationID: | tr "\n" " " >> /etc/TEAMSPlatformInfo.cisco
	cat /proc/sys/kernel/random/uuid >> /etc/TEAMSPlatformInfo.cisco

	echo SystemName: | tr "\n" " " >> /etc/TEAMSPlatformInfo.cisco
	system_name=$(cat /proc/version | cut -d '(' -f4 | cut -d ')' -f1) 2>>/etc/TEAMSInstallError.log
	echo ${system_name} >> /etc/TEAMSPlatformInfo.cisco

	echo SystemDistribution: | tr "\n" " " >> /etc/TEAMSPlatformInfo.cisco
	distribution=$(lsb_release -i | tr "\t" " " | cut -d " " -f3)
	echo ${distribution} >> /etc/TEAMSPlatformInfo.cisco

	echo SystemVersion: | tr "\n" " " >> /etc/TEAMSPlatformInfo.cisco
	system_version=$(lsb_release -d | tr "\t" " " | cut -d " " -f3,4) 2>>/etc/TEAMSInstallError.log
	echo ${system_version} >> /etc/TEAMSPlatformInfo.cisco

	echo 64bitOS: | tr "\n" " " >> /etc/TEAMSPlatformInfo.cisco
	os=`uname -m | grep 64 | cat` 2>>/etc/TEAMSInstallError.log
	if [ -z $os ]
	  then echo no >> /etc/TEAMSPlatformInfo.cisco
	  else echo yes >> /etc/TEAMSPlatformInfo.cisco
	fi
	echo CitrixClientVersion: | tr "\n" " " >> /etc/TEAMSPlatformInfo.cisco
	citrixversion=`dpkg -l | grep icaclient | awk '{print $3}'` 2>>/etc/TEAMSInstallError.log
	echo $citrixversion >> /etc/TEAMSPlatformInfo.cisco

	echo VMWareClientVersion: | tr "\n" " " >> /etc/TEAMSPlatformInfo.cisco
	vmwareversion=$(/usr/bin/vmware-view --version|grep 'VMware Horizon Client'| awk '{print $4}') 2>>/etc/TEAMSInstallError.log
	echo $vmwareversion >> /etc/TEAMSPlatformInfo.cisco

	echo HardwareInformation: | tr "\n" " " >> /etc/TEAMSPlatformInfo.cisco
	hardwareinformation=`dmidecode |grep -A 9 "System Information"| grep -w 'Product Name'| cut -d " " -f3` 2>>/etc/TEAMSInstallError.log
	echo $hardwareinformation >> /etc/TEAMSPlatformInfo.cisco

	echo CPUHardwareInformation: | tr "\n" " " >> /etc/TEAMSPlatformInfo.cisco
	cpuhardwareinformation=`cat /proc/cpuinfo | grep name| cut -f2 -d: | uniq -c` 2>>/etc/TEAMSInstallError.log
	echo $cpuhardwareinformation >> /etc/TEAMSPlatformInfo.cisco

	echo ComputerManufacturer: | tr "\n" " " >> /etc/TEAMSPlatformInfo.cisco
	computermanufacturer=`dmidecode |grep -A 9 "System Information"| grep -w 'Manufacturer'| cut -d: -f2` 2>>/etc/TEAMSInstallError.log
	echo $computermanufacturer >> /etc/TEAMSPlatformInfo.cisco

	#collect telemetry data on Ubuntu - end
	update-desktop-database -q
}

pre_upgrade() {
	pre_install
}

post_upgrade() {
	post_install
}

pre_remove() {

	if [ -e /opt/Citrix/ICAClient/libCiscoTeamsCitrixPlugin.so ] ; then
	   rm -f /opt/Citrix/ICAClient/libCiscoTeamsCitrixPlugin.so
	fi


	chmod 755 /opt/cisco/TeamsVDI/citrix-plugin-install.sh
	/opt/cisco/TeamsVDI/citrix-plugin-install.sh remove Teams
}

post_remove() {
	xdg-icon-resource forceupdate --theme hicolor &> /dev/null
	update-desktop-database -q
}