Commits

Olle Lundberg committed 8f0ee3c

Added remoe functionality

  • Participants
  • Parent commits 1008013

Comments (0)

Files changed (1)

File install-vmware-client.sh

 
 $(print_synopsis)
 Default behaviour is running the all of the actions switches
-in the order specified below.
+in the order specified below (except for -r)
 
 Actions to take
 -z          install p7zip
 -e          extract the HP ThinClient
 -a          download and install alien
 -c          convert the view client package from a deb to rpm
--i	    install the generated rpm using yum (*not done by default*)
+-i          install the generated rpm using yum (*not done by default*)
+-r          removes the rpm and every other hack done by this script
+            if -r is specified all other actions get purged from the
+            run queue and only the remove functionality is ran.
+            (this might be dangerous since there are script symlinks
+            being done by the script.)
 
 Script configurations
 -k          keep the tepmorary workspace after exiting.
 EOD
 }
 
-while getopts "kzdeaciyw:h" OPT; do
+while getopts "kzdeaciryw:h" OPT; do
 	case "${OPT}" in
 		k)
 			REMOVE="false"
 		i)
 			array_push FUNCS install_rpm
 		;;
+        r)
+            FUNCS=(remove_rpm)
+            break
+        ;;
 		w)
 			WORKDIR=${OPTARG}
 			REMOVE=false
 ) > "${DOT_DESKTOP}"
 }
 
+function remove_rpm() {
+    ensure_root "to remove the vmware client rpm"
+    rm -rf /usr/bin/libdir/lib/libcrypto.so.0.9.8
+    rm -f /etc/vmware/usb.link
+    mv /usr/share/pixmaps/view.{png,ico}
+    rpm -e $(rpm -qa vmware-view-client)
+    rm -f "${DOT_DESKTOP}"
+}
+
+print_synopsis
+
 [[ -z "${YES}" ]] && read -n1 -p 'Ready to run script. Do you want to continue (y/N) ' -e CONFIRMATION
 
 if [[ "${CONFIRMATION}"  == y || -n "${YES}" ]]; then