updated on Sat Jan 21 04:00:54 UTC 2012
[aur-mirror.git] / vmware-patch / vmware-unpatch
blob8850753c7096550a950ae6b9762aba18bd57a478
1 #!/bin/bash
3 KERNEL=`uname -r | sed 's/-.*//'`
5 VMWARE_VERSION=`vmware-installer -l | grep vmware | cut -s -d " " -f 2-`
6 VMWARE_VERSION=${VMWARE_VERSION// }
8 echo "Reverting vmware patches applied for version ${VMWARE_VERSION}"
10 timestamp=`date +%Y%m%d-%H%M%S`
11 if [ `whoami` != "root" ]
12 then
13 echo "This need to be run as root"
14 exit 1
17 echo "Reverting vmware modconfig libraries:"
18 for mod in `echo \
19 /usr/lib/vmware/lib/libvmware-modconfig-console.so/libvmware-modconfig-console.so \
20 /usr/lib/vmware/lib/libvmware-modconfig.so/libvmware-modconfig.so \
23 mv "${mod}".bak "${mod}"
24 res=$?
25 if [ $res -ne 0 ]
26 then
27 echo "* Failed to revert "`basename ${mod}`" (or nothing to revert)"
28 else
29 echo "* "`basename ${mod}`" reverted successfully"
31 done
33 echo "Reverting vmware modules source code:"
35 SRC="/usr/lib/vmware/modules/source/"
36 for mod in `ls $SRC*.tar-* | sed "s/.*\/\(.*\).tar-.*/\1/" | sort | uniq`
38 echo "* Reverting ${mod} ..."
39 LAST=`ls $SRC$mod.tar-${VMWARE_VERSION}* | sort | head -n 1`
40 cp $LAST $SRC$mod.tar
41 res=$?
42 if [ $res -ne 0 ]
43 then
44 echo " [${mod}-only] Failed to revert (or nothing to revert)"
45 rm -rf ${mod}-only
46 exit 1
47 else
48 echo " [${mod}-only] Reverted successfully"
51 done