Is someone willing to help me out? I've been using a similar script for google drive for sometime now. But with the release of backup and sync I can't seem to make this work.
#!/bin/sh -x
logfile="/Library/Logs/jss.log"
user=`ls -l /dev/console | cut -d " " -f 4`
PRODUCT="Backup and Sync from Google"
# installation
/bin/echo "`date`: Installing Backup and Sync for $user..." >> ${logfile}
dmgfile="image.dmg"
volname="Install Backup andy Sync for Google"
url="https://dl.google.com/drive/InstallBackupAndSync.dmg"
/bin/echo "`date`: Downloading $PRODUCT." >> ${logfile}
/usr/bin/curl -k -o /tmp/image.dmg $url
/bin/echo "`date`: Mounting installer disk image." >> ${logfile}
/usr/bin/hdiutil attach /tmp/image.dmg -nobrowse -quiet
/bin/echo "`date`: Installing..." >> ${logfile}
cp -R /Volumes/Install Backup and Sync from Google/Backup and Sync from Google.app /Applications/
/bin/sleep 3
/bin/echo "`date`: Unmounting installer disk image." >> ${logfile}
/usr/bin/hdiutil detach $(/bin/df | /usr/bin/grep ${volname} | awk '{print $1}') -quiet
/bin/sleep 3
open -a /Applications/Google Backup and Sync from Google.app/
From the failure log it appears that it's downloading and mounting but the installation is failing because it can't find the file needed:
Installing...'<br/> cp -R '/Volumes/Install Backup and Sync from Google/Backup and Sync from Google.app' /Applications/<br/>cp: /Volumes/Install Backup and Sync from Google/Backup and Sync from Google.app: No such file or directory<br/> /bin/sleep 3<br/>+ date<br/> /bin/echo 'Wed Sep 27 10:41:24 PDT 2017: Unmounting installer disk image.'<br/>+ /bin/df<br/> /usr/bin/grep Install Backup andy Sync for Google<br/> awk '{print $1}'<br/>grep: Backup: No such file or directory<br/>grep: andy: No such file or directory<br/>grep: Sync: No such file or directory<br/>grep: for: No such file or directory<br/>grep: Google: No such file or directory<br/> /usr/bin/hdiutil detach -quiet<br/> /bin/sleep 3<br/> open -a '/Applications/Google Backup and Sync from Google.app/'<br/>FSPathMakeRef(/Applications/Google Backup and Sync from Google.app) failed with error -43.<br/>
Any help would be appreciated.