mirror of
https://github.com/mtan93/Installomator.git
synced 2026-03-31 22:04:22 +01:00
now uses _last_ argument as the identifier, this obsoletes the JAMF variable
This commit is contained in:
@@ -19,9 +19,6 @@ export PATH=/usr/bin:/bin:/usr/sbin:/sbin
|
|||||||
# also no actual installation will be performed
|
# also no actual installation will be performed
|
||||||
DEBUG=1
|
DEBUG=1
|
||||||
|
|
||||||
# if this is set to 1, the argument will be picked up at $4 instead of $1
|
|
||||||
JAMF=0
|
|
||||||
|
|
||||||
# behavior when blocking processes are found
|
# behavior when blocking processes are found
|
||||||
BLOCKING_PROCESS_ACTION=prompt_user
|
BLOCKING_PROCESS_ACTION=prompt_user
|
||||||
# options:
|
# options:
|
||||||
@@ -142,16 +139,21 @@ downloadURLFromGit() { # $1 git user name, $2 git repo name
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
# get the identifier from the argument
|
# use the _last_ argument for the identifier
|
||||||
|
# this allows to use the command from the CLI as well as a jamf policy script
|
||||||
|
|
||||||
if [ "$JAMF" -eq 0 ]; then
|
if [[ $# -eq 0 ]]; then
|
||||||
identifier=${1:?"no identifier provided"}
|
echo "no identifier provided"
|
||||||
else
|
exit 1
|
||||||
identifier=${4:?"argument $4 required"}
|
elif [[ $# -gt 1 ]]; then
|
||||||
|
shift $(( $# - 1 ))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
identifier=${1:?"no identifier provided"}
|
||||||
|
|
||||||
|
|
||||||
# lowercase the identifier
|
# lowercase the identifier
|
||||||
identifier=$(echo "$identifier" | tr '[:upper:]' '[:lower:]' )
|
identifier=${identifier:l}
|
||||||
|
|
||||||
# get current user
|
# get current user
|
||||||
currentUser=$(scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ { print $3 }')
|
currentUser=$(scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ { print $3 }')
|
||||||
|
|||||||
Reference in New Issue
Block a user