Skip to content

Instantly share code, notes, and snippets.

@rtrouton
rtrouton / gist:10401357
Created April 10, 2014 16:49
Postinstall script for Microsoft Lync 14.0.8
#!/bin/bash
# Determine working directory
install_dir=`dirname $0`
#
# Installing Microsoft Lync
#
@rtrouton
rtrouton / gist:11221544
Last active February 27, 2018 14:44
Script that checks for JAMF's Casper agent and verifies that it's communicating properly with the Casper server. Script assumes that the user has a web server where a Casper QuickAdd package is available for download as a .zip file.
#!/bin/bash
#
# User-editable variables
#
# For the fileURL variable, put the complete address
# of the zipped Casper QuickAdd installer package
fileURL="http://server_name_here.domain.com/quickadd_name_goes_here.zip"
@rtrouton
rtrouton / gist:e4d66098937e8f21c25d
Created May 16, 2014 18:38
Script to fix the Users folder being hidden when iTunes 11.2 is installed and Find My Mac is enabled.
#!/bin/bash
# Detects if /Users is present
# If /Users is present, the
# chflags command will unhide it
if [[ -d "/Users" ]]; then
chflags nohidden "/Users"
fi
@rtrouton
rtrouton / gist:809fd31aa91501ba0124
Created June 1, 2014 18:04
Postinstall script for payload-free package which fixes the Users folder being hidden when iTunes 11.2 is installed and Find My Mac is enabled.
#!/bin/bash
# Detects if /Users is present
# If /Users is present, the
# chflags command will unhide it
if [[ -d "$3/Users" ]]; then
chflags nohidden "$3/Users"
fi
@rtrouton
rtrouton / gist:8032d209b3c810f0912f
Created June 4, 2014 14:22
Script that fixes the Casper MDM certificate on a Casper 9.x-managed Mac running 10.7.x or later.
#!/bin/bash
# Determine OS version
OSVERS=$(sw_vers -productVersion | awk -F. '{print $2}')
# Macs running 10.6.x or earlier are not able to use profiles.
# If the script detects that it is running on an OS earlier than
# 10.7.0, the script will exit at this point to avoid problems.
if [[ ${OSVERS} -lt 7 ]]; then
@rtrouton
rtrouton / com.company.fixcaspermdm.plist
Created June 15, 2014 00:15
LaunchDaemon to trigger /var/root/fixcaspermdm.sh. It runs on load and then once every 10 minutes.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.company.fixcaspermdm</string>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>/var/root/fixcaspermdm.sh</string>
@rtrouton
rtrouton / fixcaspermdm.sh
Created June 15, 2014 00:19
Script to remove and install the MDM certificate on a Casper 9.x-managed Mac running 10.7.x or later.
#!/bin/bash
#
# User-editable variables
#
# For the jss_server_address variable, put the complete
# fully qualified domain name address of your Casper server
jss_server_address="casper.server.here"
@rtrouton
rtrouton / gist:2b355dd3f57c8eada9e1
Last active August 29, 2015 14:03
Casper Extension Attribute for determining which Sophos enterprise management or update server is used by Sophos Anti-Virus
Needs more commenting and testing, but this looks like it works OK.
#!/bin/bash
# Usual location of the com.sophos.sau.plist file used
# by Sophos to pre-configure the AutoUpdate settings to
# point to a Sophos enterprise management or update server.
sophos_sau="/Library/Preferences/com.sophos.sau.plist"
@rtrouton
rtrouton / gist:d3f4d9f745f6c8fdee22
Created August 7, 2014 13:39
Script to reinstall DNAstar 12's seqninja command line symbolic links in /usr/bin
#!/bin/bash
if [ -e "/usr/bin/seqninja" ]; then
rm -rf "/usr/bin/seqninja"
fi
if [ -e "/usr/bin/seqninja12" ]; then
rm -rf "/usr/bin/seqninja12"
fi
@rtrouton
rtrouton / gist:77634c6a79c0f007aa2d
Created August 7, 2014 13:49
Script to reinstall DNAstar 11's seqninja command line symbolic links in /usr/bin
#!/bin/bash
if [ -e "/usr/bin/seqninja" ]; then
rm -rf "/usr/bin/seqninja"
fi
if [ -e "/usr/bin/seqninja11" ]; then
rm -rf "/usr/bin/seqninja11"
fi