Advertisement
adamchilcott

msOfficeTasks.sh

Sep 25th, 2017
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.78 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. ###############################
  4. # Microsoft Office 2016 For Mac
  5. ###############################
  6.  
  7. declare tempMountPoint='/tmp/mnt/'
  8. declare dmgLocation='lmnas01.avondale.edu.au/Software/Microsoft/Office/MAC'
  9. declare dmgFile='SW_DVD5_Office_Mac_Standard_2016_MultiLang_-3_.iso_MLF_X20-52737.ISO'
  10. declare pkgLocation='/Volumes/Office 2016 VL/Microsoft_Office_2016_Volume_Installer.pkg'
  11. declare dmgVolume='/Volumes/Office 2016 VL'
  12.  
  13. printf "Please Enter Your Avondale UserName e.g. s14054524: "
  14. read -r userName
  15.  
  16. ##############################
  17. # Create Temporary Mount Point
  18. ##############################
  19. mkdir "$tempMountPoint"
  20.  
  21. #####################
  22. # Mount Remote Server
  23. #####################
  24. mount -t smbfs //"$userName"@"$dmgLocation" "$tempMountPoint"
  25.  
  26. #############
  27. # Mount *.dmg
  28. #############
  29. hdiutil attach "$tempMountPoint$dmgFile"
  30.  
  31. ###############
  32. # Install *.pkg
  33. ###############
  34. installer -pkg "$pkgLocation" -target /
  35.  
  36. ##########
  37. # Clean-Up
  38. ##########
  39. hdiutil detach -force "$dmgVolume"
  40. sleep .5
  41. umount -f "$tempMountPoint"
  42.  
  43. #############
  44. # START NOTES
  45. #############
  46.  
  47. # 2-clause license ("Simplified BSD License" or "FreeBSD License")
  48. #
  49. # Copyright © 2018, Adam Brian Chilcott
  50. # All rights reserved.
  51. #
  52. # Redistribution and use in source and binary forms, with or without
  53. # modification, are permitted provided that the following conditions are met:
  54. #
  55. # 1. Redistributions of source code must retain the above copyright notice, this
  56. # list of conditions and the following disclaimer.
  57. # 2. Redistributions in binary form must reproduce the above copyright notice,
  58. # this list of conditions and the following disclaimer in the documentation
  59. # and/or other materials provided with the distribution.
  60. #
  61. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  62. # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  63. # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  64. # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
  65. # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  66. # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  67. # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  68. # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  69. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  70. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  71. #
  72. # The views and conclusions contained in the software and documentation are those
  73. # of the authors and should not be interpreted as representing official policies,
  74. # either expressed or implied, of the FreeBSD Project.
  75.  
  76. ###########
  77. # END NOTES
  78. ###########
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement