-
Notifications
You must be signed in to change notification settings - Fork 0
/
AccountEdgeNE.sh
81 lines (64 loc) · 2.8 KB
/
AccountEdgeNE.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/sh
#####################################################################################################
#
# ABOUT THIS PROGRAM
#
# NAME
# AccountEdgeNE.sh -- Installs or updates AccountEdge Network Edition
#
# SYNOPSIS
# sudo AccountEdgeNE.sh
#
####################################################################################################
#
# HISTORY
#
# Version: 1.7
#
# - 1.0 Martyn Watts, 19.01.2022 Initial Build
#
####################################################################################################
# Script to download and install AccountEdge Network Edition.
#
downloadUrl='https://www.dropbox.com/s/649fftn7q2d4z5n/AENE_r25.1.9.dmg.zip?dl=1'
dnldfile='AENE_r25.19.dmg.zip'
appName='AccountEdge NE'
forceQuit='Y'
logfile="/Library/Caches/com.purplecomputing.mdm/Logs/AccountEdgeNEInstallScript.log"
deplog="/var/tmp/depnotify.log"
OSvers_URL=$( sw_vers -productVersion | sed 's/[.]/_/g' )
userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X ${OSvers_URL}) AppleWebKit/535.6.2 (KHTML, like Gecko) Version/5.2 Safari/535.6.2"
scriptver="1.0"
# Making Purple Cache directories for in the event that the helper script hasn't been run
mkdir -p /Library/Caches/com.purplecomputing.mdm/
mkdir -p /Library/Caches/com.purplecomputing.mdm/Logs/
mkdir -p /Library/Caches/com.purplecomputing.mdm/Apps/
/bin/echo "Status: Installing ${appName}" >> ${deplog}
/bin/echo "Status: Installing ${appName}" >> ${logfile}
if [[ $@ == "openconsole" ]]; then
open ${logfile}
open ${deplog}
fi
/bin/echo "Script Version: ${scriptver}" >> ${logfile}
/bin/echo "`date`: Downloading." >> ${logfile}
/bin/echo "Downloading."
/usr/bin/curl -L -o /Library/Caches/com.purplecomputing.mdm/Apps/${dnldfile} ${downloadUrl}
if [[ "${forceQuit}" = "Y" ]]; then
killall ${appName}
fi
cd /Library/Caches/com.purplecomputing.mdm/Apps/
unzip ${dnldfile}
/bin/echo "`date`: Mounting installer disk image." >> ${logfile}
/usr/bin/hdiutil attach /Library/Caches/com.purplecomputing.mdm/Apps/${appName}.dmg -nobrowse -quiet
/bin/echo "`date`: Installing..." >> ${logfile}
ditto -rsrc "/Volumes/"${appName}/${appName}".app" "/Applications/"${appName}".app"
cd /Library/Caches/com.purplecomputing.mdm/Apps/
/usr/sbin/installer -pkg FileConnect.pkg -target /
/bin/sleep 10
/bin/echo "`date`: Unmounting installer disk image." >> ${logfile}
/usr/bin/hdiutil detach $(/bin/df | /usr/bin/grep AppName | awk '{print $1}') -quiet
/bin/sleep 10
/bin/sleep 5
/bin/echo "`date`: Deleting the downloaded file." >> ${logfile}
/bin/rm /Library/Caches/com.purplecomputing.mdm/Apps/${dnldfile}
/bin/echo "Command: DeterminateManualStep: 1" >> ${deplog}