Skip to content

Commit

Permalink
enable VNC script, info script... run it from Casper Self Service.
Browse files Browse the repository at this point in the history
  • Loading branch information
loceee committed Oct 23, 2015
1 parent 85d4c0e commit 4fd4464
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cfgScripts/cfgsysEnableVNC.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
#
# turn on vnc for Mac

vncpassword="${4}"

if [ -n "${vncpassword}" ]
then
echo "Kickstarting ARD enabling VNC..."
/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -clientopts -setvnclegacy -vnclegacy yes -setvncpw -vncpw ${vncpassword} -restart -agent
fi
exit 0
27 changes: 27 additions & 0 deletions infoAboutMyMac.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
#
# what's my ip and stuff
#
# run me from a self service policy (handy if windows guys need to VNC on for remote support)

displayDialog()
{
osascript -e "tell app \"System Events\"" -e "activate" -e "display dialog \"$message\" with title \"Information about your Mac\" buttons {\"OK\"}" -e "end tell"
}

makeMessage()
{
message="$message\n$1"
}

myip=$(ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1' | head -n1)
compname=$(scutil --get ComputerName)
username=$(who | grep console | awk '{print $1}')

makeMessage "User: $username"
makeMessage "IP address: $myip"
makeMessage "Computer Name: $compname"

displayDialog "$message" &

exit

0 comments on commit 4fd4464

Please sign in to comment.