-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Storage Management Launch.sh
63 lines (44 loc) · 2.07 KB
/
Storage Management Launch.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
#!/bin/bash
####################################################################################################
#
# ABOUT
#
# Launch Storage Management.app
#
####################################################################################################
#
# HISTORY
#
# Version 1.0.0, 24-May-2018, Dan K. Snelson
# Original version
#
####################################################################################################
####################################################################################################
#
# Variables
#
####################################################################################################
scriptVersion="1.0.0"
scriptResult="Version ${scriptVersion}; "
loggedInUser=$( /bin/echo "show State:/Users/ConsoleUser" | /usr/sbin/scutil | /usr/bin/awk '/Name :/ { print $3 }' )
####################################################################################################
#
# Program
#
####################################################################################################
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Logging preamble
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
echo "Launch Storage Management.app (${scriptVersion})"
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Launch Storage Management.app as the currently logged-in user
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
/usr/bin/su \- "${loggedInUser}" -c "/usr/bin/open '/System/Library/CoreServices/Applications/Storage Management.app'"
scriptResult+="Launched Storage Management.app as ${loggedInUser}; "
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Exit
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
scriptResult+="End-of-line"
echo ${scriptResult}
exit 0 ## Success
exit 1 ## Failure