-
Notifications
You must be signed in to change notification settings - Fork 0
/
arch_vmwaretools_install.sh
56 lines (43 loc) · 1.63 KB
/
arch_vmwaretools_install.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
54
55
56
#!/bin/bash
if [ "$(id -u)" -ne 0 ]; then
echo "This script must be run as root" >&2
exit 1
fi
echo "Updating system package database and upgrading packages..."
pacman -Syu --noconfirm
# Install base dependencies
pacman -S base-devel net-tools linux-headers --noconfirm
# Prompt user to install VMWareTools via VMWare Tab...
read -p "NOTE: VMWare Tools needs to be installed before mounting CDRom! Go To 'VM > Install VMWare Tools'. Are VMWare Tools Installed? (y/n) " answer
case $answer in
[Yy]* )
echo "VMWareTools is already installed. Proceeding..."
;;
[Nn]* )
echo "Please first install VMWare Tools By Going To 'VM > Install VMWare Tools'. Exiting Script."
exit 0
;;
* )
echo "Invalid Input. Please answer y or n."
exit 1
;;
esac
# Creat bogus init directories for the installer
for x in {0..6}; do mkdir -p /etc/init.d/rc${x}.d; done
# Mounting CDRom
echo "Mounting CDROM..."
mount /dev/cdrom /mnt
# Extracting .tar file to '/root'
# search_dir="/mnt"
# Find the most recent version of VMwareTools downloaded in the /mnt directory
# recent_file=$(find "$search_dir" -type f -name 'VMware-Tools-*' -printf '%T+ %p\n' | sort -r | head -n 1 | cut -d' ' -f2-)
# Extract VMware-Tools
echo "Extracting VMware-Tools..."
tar xf /mnt/VMware-Tools*.tar.gz -C /root
# Uninstall the last version of vmware-tools by running the uninstall perl script
echo "Running vmware-uninstall script to remove any previous versions..."
/usr/bin/vmware-uninstall-tools.pl
# Run the vmware-tools install perl script
echo "Running the vmware-tools install perl script..."
perl /root/vmware-tools-distrib/vmware-install.pl
echo "Installation Complete!"