<commit_before>#!/bin/bash
# Created by <NAME>
# Copyright 2012 Technology Revealed. All rights reserved.
# PI checkin
vers="pi-checkin-0.3"
# 0.1 Initial testing
# 0.2 Populates empty settings.plist
# 0.3 HostName as Name, and ComputerName if hostname is not set.


# Curls remote settings from the server.
# loads or unloads com.trmacs.pinotify.plist if PIEnabled is false
# loads com.trmacs.pinotify.plist if PIEnabled is true.

log="/Library/Logs/com.trmacs/pi-checkin.log"
err_log="/Library/Logs/com.trmacs/pi-checkin-err.log"
exec 1>> "${log}" 
exec 2>> "${err_log}"
when=$(date +%Y-%m-%d)
#NAME=`scutil --get ComputerName`

# Get the hosts name. Using Computername if HostName is not set.
host_raw="$(scutil --get HostName)"

if [ -z "$host_raw" ]; then
	NAME="$(scutil --get ComputerName)"
else	
	NAME="$host_raw"
fi


# Grab remote settings - grab default if none specific for the computer.
remote=$(curl -s http://munki.benbass.com:9000/pi/"$NAME".plist)
remote_chck="$(echo "$remote" | head -1 | cut -c 2)" 

# if not a valid plist and a http error code the second character will be a ! instead of a ?
if [ "$remote_chck" = ! ]; then
	remote=$(curl -s http://munki.benbass.com:9000/pi/default.plist)
fi

echo "$remote" > /Library/Scripts/trmacs/"$NAME".plist

# If the settings.plist does not exist, Merge it with the curled version
if [ ! -f /Library/Scripts/trmacs/settings.plist ]; then 
/usr/libexec/PlistBuddy -c  "Merge /Library/Scripts/trmacs/"$NAME".plist" /Library/Scripts/trmacs/settings.plist
fi

<commit_msg>checkin change<commit_after>#!/bin/bash
# Created by <NAME>
# Copyright 2012 Technology Revealed. All rights reserved.
# PI checkin
vers="pi-checkin-0.4"
# 0.1 Initial testing
# 0.2 Populates empty settings.plist
# 0.3 HostName as Name, and ComputerName if hostname is not set.
$ 0.4 Moving to miniserver.trmacs.com for checkins.


# Curls remote settings from the server.
# loads or unloads com.trmacs.pinotify.plist if PIEnabled is false
# loads com.trmacs.pinotify.plist if PIEnabled is true.

log="/Library/Logs/com.trmacs/pi-checkin.log"
err_log="/Library/Logs/com.trmacs/pi-checkin-err.log"
exec 1>> "${log}" 
exec 2>> "${err_log}"
when=$(date +%Y-%m-%d)
#NAME=`scutil --get ComputerName`

# Get the hosts name. Using Computername if HostName is not set.
host_raw="$(scutil --get HostName)"

if [ -z "$host_raw" ]; then
	NAME="$(scutil --get ComputerName)"
else	
	NAME="$host_raw"
fi


# Grab remote settings - grab default if none specific for the computer.
remote=$(curl -s http://miniserver.trmacs.com/pi/"$NAME".plist)
remote_chck="$(echo "$remote" | head -1 | cut -c 2)" 

# if not a valid plist and a http error code the second character will be a ! instead of a ?
if [ "$remote_chck" = ! ]; then
	remote=$(curl -s http://miniserver.trmacs.com/pi/default.plist)
fi

echo "$remote" > /Library/Scripts/trmacs/"$NAME".plist

# If the settings.plist does not exist, Merge it with the curled version
if [ ! -f /Library/Scripts/trmacs/settings.plist ]; then 
/usr/libexec/PlistBuddy -c  "Merge /Library/Scripts/trmacs/"$NAME".plist" /Library/Scripts/trmacs/settings.plist
fi


{'fraction_non_alphanumeric': 0.14423385801477676, 'fraction_numerical': 0.013491808544812078, 'mean_word_length': 4.079934747145187, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2090777', 'n_tokens_mistral': 1163, 'n_tokens_neox': 1087, 'n_words': 329}