summarylogtreecommitdiffstats
path: root/vmware-unpatch
diff options
context:
space:
mode:
authorDet2015-06-14 04:13:28 +0300
committerDet2015-06-14 04:14:16 +0300
commitdae87d2d534f6345098058d668a860d4c061e0ae (patch)
treeb42c9739f8ef85031cf1445f8dc6d0c7f2a00f83 /vmware-unpatch
downloadaur-dae87d2d534f6345098058d668a860d4c061e0ae.tar.gz
Initial import: 11.1.0-5
Diffstat (limited to 'vmware-unpatch')
-rwxr-xr-xvmware-unpatch61
1 files changed, 61 insertions, 0 deletions
diff --git a/vmware-unpatch b/vmware-unpatch
new file mode 100755
index 000000000000..6180bc2352a8
--- /dev/null
+++ b/vmware-unpatch
@@ -0,0 +1,61 @@
+#!/bin/bash -e
+
+# Source common functions
+. /usr/share/vmware-patch/common-functions.sh
+
+# Help message
+usage() {
+ echo "Usage: $(basename $0) [-v/-V|-h]"
+ echo "Revert the VMware modules sources."
+ echo
+ echo "Available options:"
+ echo " -v, -V, --version Print version information"
+ echo " -h, --help Print this help"
+}
+
+# Flags
+while [[ $1 ]]; do
+ # Define actions
+ case "$1" in
+ -v | -V | --version) print_version; exit 0 ;;
+ -h | --help) usage; exit 0 ;;
+ -*) echo "$(basename $0): error: bad argument: $1"
+ echo
+ usage $1; exit 0 ;;
+ *) break ;;
+ esac
+ shift
+done
+
+# Make sure we are root
+root_check
+
+# Is a VMware product installed?
+vmware_check
+
+# Product name
+set_product_name
+
+# Remove leftover module locations
+remove_leftover_module_dirs
+
+cd /usr/lib/vmware/modules/
+
+# Remove old backups
+remove_old_backups
+
+# Revert
+cd /usr/lib/vmware/modules/
+if [[ -d source-$ver ]]; then
+ msg "Reverting $name v$ver module sources.."
+ msg2 "Removing $(readlink -f source)/"
+ rm -r source/
+
+ msg2 "Renaming backup: $(readlink -f source-$ver)/ -> $(readlink -f source)/"
+ mv "source-$ver/" source/
+
+ msg3 "Done."
+else # Nothing found
+ error "No backups found."
+ exit
+fi