Skip to content

Instantly share code, notes, and snippets.

View smashism's full-sized avatar
:shipit:
ship it!

emily smashism

:shipit:
ship it!
View GitHub Profile
@smashism
smashism / get_github_version.sh
Created March 23, 2015 15:07
get_github_version
#!/bin/sh
#
# checks for github.app on machine
# using version integer rather than name
# intended for scoping updates (with patchoo)
# by github.com/smashism
# https://github.com/smashism/casper-extension-attributes/blob/master/get_github_version
# last updated 2015-03-20
#
@smashism
smashism / omnigraffle5_ea.sh
Created August 22, 2015 16:58
omnigraffle5 ea
#!/bin/sh
#
# by emily k 2014-06-10
# checks for omnigraffle 5 sn
# updated 2015-08-21
#gets current user
currentUser=`ls -l /dev/console | cut -d " " -f 4`
#checks for app, then checks user library for license file
#!/bin/sh
/usr/local/bin/jamf launchJAMFHelper -path '/Library/Application Support/JAMF/bin/jamfHelper.app'
#!/bin/bash
#
# software_update_count.sh
# gets amount of updates in integer for EA <> Smart Computer group
# github.com/smashism
# last update: 2016-10-18
#
# get LastUpdatesAvailable
#!/bin/bash
# Get current user and OS information.
CURRENT_USER=$(/usr/bin/stat -f%Su /dev/console)
USER_ID=$(id -u "$CURRENT_USER")
OS_MAJOR=$(/usr/bin/sw_vers -productVersion | awk -F . '{print $1}')
OS_MINOR=$(/usr/bin/sw_vers -productVersion | awk -F . '{print $2}')
# Launch the app using launchctl.
echo "Launching App Store..."
#!/bin/sh
####################################################
## Use the legacy binary if running on < 10.7
####################################################
os_version=$(system_profiler SPSoftwareDataType -xml | grep -A 2 'os_version</key>' | grep -o 'OS X [0-9]\+.[0-9]\+' | grep -o '[0-9]\+.[0-9]\+')
major_version=$(echo $os_version | grep -o '[0-9]\+\.' | grep -o '[0-9]\+')
minor_version=$(echo $os_version | grep -o '\.[0-9]\+' | grep -o '[0-9]\+')
/usr/bin/tar -xf /private/tmp/JAMFQuickAdd/Binaries.tar.gz -C /private/tmp/JAMFQuickAdd
/bin/mkdir -p /usr/local/bin
#!/bin/sh
####################################################
## Use the legacy binary if running on < 10.7
####################################################
os_version=$(system_profiler SPSoftwareDataType -xml | grep -A 2 'os_version</key>' | grep -o 'OS X [0-9]\+.[0-9]\+' | grep -o '[0-9]\+.[0-9]\+')
major_version=$(echo $os_version | grep -o '[0-9]\+\.' | grep -o '[0-9]\+')
minor_version=$(echo $os_version | grep -o '\.[0-9]\+' | grep -o '[0-9]\+')
/usr/bin/tar -xf /private/tmp/JAMFQuickAdd/Binaries.tar.gz -C /private/tmp/JAMFQuickAdd
/bin/mkdir -p /usr/local/bin
#!/bin/sh
# gets user and location data to populate computer record
# can run on policy at any time
# by emily
# last updated 2016-12-02
# Get the logged in users username
loggedInUser=$(python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");')
#!/bin/bash
###
#
# Name: type_TouchBar.sh
# Description: Check for presense of Touch Bar Agent to see if a machine has
# a Touch Bar or not. Results can then be used to create a smart
# group based on type.
# Author: Emily Kausalik (drkausalik@gmail.com)
# Created: 2016-12-15
#!/bin/bash
if ioreg | grep "AppleEmbeddedOSSupportHost"; then
touch_bar="Yes"
else
touch_bar="No"
fi
echo "<result>$touch_bar</result>"