Advertisement
Guest User

Untitled

a guest
Feb 15th, 2017
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # Purpose: Copy installer from remote, centralized software repo and install.
  4. # Date: 2/15/2017
  5. # Version: 1.2
  6.  
  7. ### As with all scripts, it needs to be ran as root. Checking credentials.
  8.  
  9. if [ "$USER" != "root" ]; then
  10. echo "************************************"
  11. echo "You are attempting to execute this process as user $USER"
  12. echo "Please execute the script with elevated permissions."
  13. exit 1
  14. fi
  15.  
  16. # Now we need to authenticate with domain credentials
  17. read -p 'Please enter your network username:' domainusername
  18. read -s -p 'Please enter your AD password: ' domainpass
  19.  
  20. function setup()
  21. {
  22. # Now we need to make a mount point for the NFS share.
  23. mkdir /Volumes/local_directory
  24. mount_smbfs "//$domainusername:$domainpass@servername.ad.company.com/folder_name" /Volumes/local_directory
  25.  
  26. #Example software
  27.  
  28. echo "Copying over Skype For Business..."
  29. cp /Volumes/local_directory/SkypeForBusiness.pkg ~/Desktop
  30.  
  31. echo "Copying over Microsoft Office 2016..."
  32. cp /Volumes/local_directory/Microsoft_Office.pkg ~/Desktop
  33.  
  34. echo "Installing Skype for Business for Mac:"
  35. /usr/sbin/installer -pkg ~/Desktop/"SkypeForBusiness.pkg" -target "/"
  36. echo
  37. echo "Skype for Business is now installed."
  38. echo
  39. echo "Installing Microsoft Office 2016 for Mac:"
  40. echo
  41. /usr/sbin/installer -pkg ~/Desktop/"Microsoft_Office.pkg" -target "/"
  42. echo
  43. echo "Microsoft Office 2016 for Mac is now installed."
  44.  
  45. echo "Removing install files. "
  46.  
  47. rm ~/Desktop/Microsoft_Office.pkg
  48. rm ~/Desktop/SkypeForBusiness.pkg
  49.  
  50. umount /Volumes/local_directory
  51. }
  52.  
  53. setup
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement