Skip to content

Instantly share code, notes, and snippets.

View SamRothCA's full-sized avatar

Sam Rothenberg SamRothCA

  • San Francisco, CA
View GitHub Profile
@SamRothCA
SamRothCA / Regex.swift
Created December 27, 2015 17:04 — forked from ningsuhen/Regex.swift
Swift extension for Native String class to support Regex match and Regex replace. Credit - http://www.swift-studies.com/blog/2014/6/12/regex-matching-and-template-replacement-operators-in-swift
import Foundation
struct Regex: StringLiteralConvertible {
var pattern: String {
didSet {
updateRegex()
}
}
var expressionOptions: NSRegularExpressionOptions {
didSet {
CheckForGroup=`id -Gn $1`
if [[ "$CheckForGroup" == *macstaff* ]]; then
curl -o --url macserver.cfsd16.org/test_profile.mobileconfig --output /Library/Management/test_profile.mobileconfig
sudo profiles -I -F /Library/Management/test_profile.mobileconfig
echo "You are a macstaff" >> /var/log/login.log
exit 0
fi