Skip to content

Instantly share code, notes, and snippets.

View jaredsiegel's full-sized avatar

jaredsiegel

View GitHub Profile
#!/bin/sh
# Location of macOS Build plist for comparison
# Subsitute your org name for anyOrg, or place in another location
buildPlist="/usr/local/anyOrg/macOSBuild.plist"
# Get the local os build version
# Using build version accounts for supplimental updates as well as dot updates and os upgrades
localOS=$( /usr/bin/sw_vers | awk '/BuildVersion/{print $2}' )
@jaredsiegel
jaredsiegel / script-template.sh
Created December 17, 2020 17:04 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
#!/bin/bash
#
#
# COMPUTER_NAME_MAXLEN - Maximum length the computer name can be. If binding
# to Active Directory this should be 15.
#
# AD_BIND_TO_DOMAIN - If not empty, bind to the given AD domain.
#
# AD_MOBILE - Enable mobile user accounts ('enable' or 'disable').