This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# set -xv | |
# Required commands | |
declare -x awk="/usr/bin/awk" | |
declare -x dscl="/usr/bin/dscl" | |
declare -x defaults="/usr/bin/defaults" | |
declare -x cat="/bin/cat" | |
declare -x du="/usr/bin/du" | |
declare -x id="/usr/bin/id" | |
declare -x ntpdate="ntpdate" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
[ "$EUID" != 0 ] && | |
printf "%s\n" "This script requires root access ($EUID)!" && exit 1 | |
[ -f /System/Library/CoreServices/ServerVersion.plist ] && | |
printf "%s\n" "This should not be run on Mac OS X Server!" && exit 1 | |
[ -d /Library/Filesystems/Xsan/ ] && | |
printf "%s\n" "You must remove Xsan on this system before using this tool" && exit 1 | |
# Required commands | |
declare -x awk="/usr/bin/awk" | |
declare -x cat="/bin/cat" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# set -xv | |
declare -x DST_DIR="$1" | |
declare -x DS_DOMAIN='/Active Directory/All Domains' | |
declare -x GROUP_ATTR='GroupMembership' | |
declare -x GROUP_NAME='DPS\teachers.388-wgp.vc - elementary' | |
declare -x NT_DOMAIN="$(dscl "$DS_DOMAIN" -read / PrimaryNTDomain | | |
awk '{print $NF}')" | |
if [ "${#DST_DIR}" -eq 0 ] ; then | |
echo "You must specify a destination directory" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
declare -x MIRROR_VOL="Server HD" | |
declare -x RAID_VOL="/Volumes/Server HD" | |
declare -x RAID_VOL2="/Volumes/Server HD 2" | |
declare -x diskutil="/usr/sbin/diskutil" | |
# Name as MirroredVolume for Novice users in disk utility | |
$diskutil createRAID mirror "ServerRAID" JHFS+ "$RAID_VOL" "$RAID_VOL2" | |
# Rename to HD Name | |
$diskutil renameVolume /Volumes/ServerRAID "$MIRROR_VOL" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for DSEXPORT in *.dsimport ; do | |
dseditgroup -o edit -n /LDAPv3/127.0.0.1 -u diradmin -P foobar -a "${DSEXPORT%%.dsimport}" -t user teachers | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
declare -x USER_NAME="$1" | |
declare -x TEMPLATE_KEYCHAIN="/System/Library/User Template/English.lproj/Library/Keychains/login.keychain" | |
declare -x USER_KEYCHAIN="/Users/$USER_NAME/Library/Keychains/login.keychain" | |
# Commands | |
declare -x rm="/bin/rm" | |
declare -x mv="/bin/mv" | |
declare -x logger="/usr/bin/logger" | |
if [ -f "$TEMPLATE_KEYCHAIN" ] ; then | |
$rm "$TEMPLATE_KEYCHAIN" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Required commands | |
declare -x awk="/usr/bin/awk" | |
declare -x dscl="/usr/bin/dscl" | |
declare -x defaults="/usr/bin/defaults" | |
declare -x dscacheutil="/usr/bin/dscacheutil" | |
declare -x du="/usr/bin/du" | |
declare -x id="/usr/bin/id" | |
declare -x ntpdate="ntpdate" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
awk=/usr/bin/awk | |
ifconfig=/sbin/ifconfig | |
scutil=/usr/sbin/scutil | |
COMPUTER_NAME=`$scutil --get ComputerName` | |
LOCAL_HOST_NAME=`$scutil --get LocalHostName` | |
MAC_ADDRESS=`$ifconfig en0 ether | $awk '/ether/{gsub(":","",$NF);print $NF}'` | |
if [ "${#COMPUTER_NAME}" -gt 15 ] ; then | |
echo "Computer Name is greater then 15!" | |
if [ "${#LOCAL_HOST_NAME}" -gt 15 ] ; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# configure RAIDs | |
echo yes | raidutil delete volume -n Vol-RS1 | |
echo yes | raidutil delete volume -n Vol-RS2 | |
echo yes | raidutil delete volume -n Vol-RS3 | |
raidutil delete raidset -n RS1 | |
raidutil delete raidset -n RS2 | |
raidutil delete raidset -n RS3 | |
raidutil createraidset -n "Raid5Set" -d 1,2,3 -r 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Runtime configuration | |
export SCHOOL_SITE="$(/bin/hostname -s | | |
/usr/bin/sed 's/ap.s0.//g' | /usr/bin/tr '[:lower:]' '[:upper:]')" | |
# Overrides for sites | |
if [ "$SCHOOL_SITE" = "SSC" ] ; then | |
export SCHOOL_SITE=TSD | |
fi | |
if [ "$SCHOOL_SITE" = "ADMIN" ] ; then |