43 lines
1.1 KiB
Bash
43 lines
1.1 KiB
Bash
#!/bin/bash
|
|
|
|
##########################################################################
|
|
# Shellscript : Prüft, ob das Ticket das eigene ist.
|
|
# Autor : Andreas Vogel, macenterprise gmbh, 13.11.2019
|
|
##########################################################################
|
|
|
|
user=$(stat -f '%u %Su' /dev/console | cut -d ' ' -f 2)
|
|
TicketIs=$(klist --list-all | grep DIBA.CORP.INT | cut -d ' ' -f 2)
|
|
|
|
Diba=@DIBA.CORP.INT
|
|
name=$user$Diba
|
|
|
|
jamfHelper="/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper"
|
|
jamf="/usr/local/bin/jamf"
|
|
Icon="/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/ToolbarDeleteIcon.icns"
|
|
|
|
Message="Das Angeforderte Ticket: $Ticket scheint nicht dir zu gehören.
|
|
|
|
Das Ticket wurde entfernt und ein SecurityLog wurde erstellt.
|
|
"
|
|
|
|
if [[ ! -z "$TicketIs" ]]
|
|
then
|
|
|
|
if [[ $name == $TicketIs ]]
|
|
then
|
|
|
|
exit 0
|
|
else
|
|
HELPER=$("$jamfHelper" -windowType utility -icon "$Icon" -title "Wrong Ticket" -description "$Message" -button1 "OK" -defaultButton 1)
|
|
kdestroy -p $TicketIs
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|