Posted on 07-16-2019 08:15 AM
I'm currently running into an error while trying to run this script for RingCentral Meetings:
#!/bin/sh
####################################################################################################
#
# RingCentral Meetings.app Installation Script
#
####################################################################################################
#
# DESCRIPTION
#
# Automatically download and install or upgrade the latest version of the
# RingCentral Meetings.app VOIP application
#
####################################################################################################
#
# HISTORY
#
# Created by Caine Hörr on 2017-03-14
#
# v1.2 - 2017-03-16 - Caine Hörr
# Set all URLs to use https (SSL)
# Added the following line: echo "Downloading from:" ${VendorURL}${VendorRelativeFilenamePath} for logging purposes
#
# v1.1 - 2017-03-15 - Caine Hörr
# Added -i flag to VendorRelativeFilenamePath="$( curl -sI $VendorDownloadURL | grep -i "location" | awk '{ print $2 }' )"
# Added sudo to sudo rm -rf /Applications/RingCentral Meetings.app
#
# v1.0 - 2017-03-14 - Caine Hörr
# Initial RingCentral Meetings.app Installation Script
#
#
# THESE VALUES ARE EDITABLE...
#
# Vendor URL
VendorURL="https://downloads.ringcentral.com"
# Vendor Download URL
VendorDownloadURL="http://dn.ringcentral.com/data/web/download/RCMeetings/1210/RCMeetingsClientSetup.pkg"
# Local directory to save to...
LocalSaveDirectory="/tmp/"
# DMG Mount Point
DMGMountPoint="/Volumes/RingCentral Meetings"
#
# DO NOT EDIT BELOW THIS LINE
#
# Check to see if RingCentral Meetings already exists in /Applications
CheckForRingCentralApp="$(ls /Applications/ | grep "RingCentral Meetings")"
if [ "$CheckForRingCentralApp" = "RingCentral Meetings.app" ]; then
echo "RingCentral Meetings.app currently installed..."
# Check to see if RingCentral Meetings is running
RingCentralRunning="$(ps aux | grep "/Applications/RingCentral Meetings.app/Contents/MacOS/RingCentral Meetings" | awk '{ print $11 }' | grep "/Applications/RingCentral")"
if [ "$RingCentralRunning" = "/Applications/RingCentral" ]; then
echo "RingCentral Meetings.app is running..."
echo "Quitting RingCentral Meetings.app..."
# Gracefully Quit RingCentral Meetings.app
osascript -e 'quit app "RingCentral Meetings"'
else
echo "RingCentral Meetings.app is not running..."
fi
echo "Deleting /Applications/RingCentral Meetings.app..."
rm -rf /Applications/RingCentral Meetings.app
else
echo "RingCentral Meetings.app not currently installed..."
fi
echo "Installing latest version of RingCentral Meetings.app..."
echo ""
# Vendor Relative Path to File
VendorRelativeFilenamePath="$( curl -sI $VendorDownloadURL | grep Location | awk '{ print $2 }' )"
echo "Downloading from:" ${VendorURL}${VendorRelativeFilenamePath}
echo
# Remove
(CR) at the end ( 0d )
VendorRelativeFilenamePath=${VendorRelativeFilenamePath%$'
'}
# Vendor Dynamic Filename as Downloaded
VendorDynamicFilename="${VendorRelativeFilenamePath##*/}"
# Vendor Full Download URL
VendorFullDownloadURL=${VendorURL}${VendorRelativeFilenamePath}
# Download vendor supplied DMG file to local save directory
curl ${VendorFullDownloadURL} -o ${LocalSaveDirectory}${VendorDynamicFilename}
# Mount vendor supplied DMG File
echo "Mounting" ${LocalSaveDirectory}${VendorDynamicFilename} "..."
hdiutil attach ${LocalSaveDirectory}${VendorDynamicFilename} -nobrowse
# Copy contents of vendor supplied DMG file to /Applications/
# Preserve all file attributes and ACLs
echo "Copying RingCentral Meetings.app into the /Applications/ folder..."
cp -pPR /Volumes/RingCentral /RingCentral Meetings.app /Applications/
# Identify the exact mount point for the DMG file
#ProperDMGMountPoint="$(hdiutil info | grep "$DMGMountPoint" | awk '{ print $1 }')"
# Unmount the vendor supplied DMG file
echo "Unmounting" ${ProperDMGMountPoint}"..."
hdiutil detach /Volumes/RingCentral Meetings
# Remove the downloaded vendor supplied DMG file
echo "Removing" ${LocalSaveDirectory}${VendorDynamicFilename}"..."
rm -f $LocalSaveDirectory$VendorDynamicFilename
# Launch RingCentral Meetings.app
#open /Applications/RingCentral Meetings.app
echo "Installation complete!"
The original template for this script can be found here: https://www.jamf.com/jamf-nation/discussions/23392/ringcentral-for-mac-app-let-your-users-download-the-latest-version-via-self-service
What I've done is substitute all the variables of "RingCentral for Mac" for "RingCentral Meetings" and while this has worked for me for RingCentral Phone, it keeps failing at a few different steps for RC Meetings and I'm not sure how to proceed. Could someone help as another set of eyes/tell me what I could be doing better? Here is my error log:
Executing Policy RingCentral Meetings
Running script RingCentral Meetings...
Script exit code: 0
Script result: RingCentral Meetings.app not currently installed...
Installing latest version of RingCentral Meetings.app...
Downloading from: https://downloads.ringcentral.com
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0Warning: Failed to create the file /tmp/: Is a directory
100 345 100 345 0 0 3080 0 --:--:-- --:--:-- --:--:-- 3108
curl: (23) Failed writing body (0 != 345)
Mounting /tmp/ ...
hdiutil: attach failed - image not recognized
Copying RingCentral Meetings.app into the /Applications/ folder...
cp: /Volumes/RingCentral /RingCentral Meetings.app: No such file or directory
Unmounting ...
hdiutil: detach failed - No such file or directory
Removing /tmp/...
rm: /tmp/: is a directory
Installation complete!