<commit_before>#!/bin/sh -
#About: this script sends an email if your IP address change, it's supposed to run on cron

email="<EMAIL>"

function checkDependencies(){
    for i in $*; do
        type $i >/dev/null 2>&1 || { echo "$i dependency missing"; return 1; }
    done
}
function sendMail(){
    # TODO: Find a way to send autehticated mails via bash without 3rd party applications.
    echo -ne "Hello, my ip changed to: $1" |mail -s "IP Changed" $email
}
function sendNotification(){
    ./terminal-notifier -title "$1" -message "$2"
}
function checkIp(){
    jsonip=`curl jsonip.com -s |cut -d "\"" -f 4`
    [[ -f lastIp ]] || touch lastIp
    [[ `cat lastIp` == $jsonip ]] || {
        sendMail $jsonip;
        [[ `uname` == "Darwin" ]] && sendNotification "IPMailer" "IP changed to $jsonip";
    }
    echo $jsonip > lastIp<commit_msg>Better echoing to POSIX compliance<commit_after>#!/bin/sh -
#About: this script sends an email if your IP address change, it's supposed to run on cron

email="<EMAIL>"

function checkDependencies(){
    for i in $*; do
        type $i >/dev/null 2>&1 || { echo "$i dependency missing"; return 1; }
    done
}
function sendMail(){
    # TODO: Find a way to send autehticated mails via bash without 3rd party applications.
    echo "Hello, my ip changed to: $1" |mail -s "IP Changed" $email
}
function sendNotification(){
    ./terminal-notifier -title "$1" -message "$2"
}
function checkIp(){
    jsonip=`curl jsonip.com -s |cut -d "\"" -f 4`
    [[ -f lastIp ]] || touch lastIp
    [[ `cat lastIp` == $jsonip ]] || {
        sendMail $jsonip;
        [[ `uname` == "Darwin" ]] && sendNotification "IPMailer" "IP changed to $jsonip";
    }
    echo $jsonip > lastIp
{'fraction_non_alphanumeric': 0.15020455873758037, 'fraction_numerical': 0.009351256575102279, 'mean_word_length': 3.0665083135391926, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '5236586', 'n_tokens_mistral': 585, 'n_tokens_neox': 556, 'n_words': 204}