<commit_before>#!/usr/bin/env bash

mkdir ~/Library/Logs/Lantern

function log() {
  echo "`date`: $@" >> ~/Library/Logs/Lantern/installer.log
}

log "Configuring network services"
onOff=$1
url=$2
#port=$3
log "Setting to on or off: $onOff"
while read s; 
do
    log "Configuring network: $s"
    networksetup -setautoproxyurl "$s" $url || log "Could not set auto proxy URL for $s"
    networksetup -setautoproxystate "$s" "$onOff" || log "Could not turn auto proxy on for $s"
    log "Configured network: $s"
done < <(networksetup -listallnetworkservices | tail +2)
log "Done configuring network services!!"

<commit_msg>only make one request for password, instead of two per interface<commit_after>#!/usr/bin/env bash

mkdir -p ~/Library/Logs/Lantern

function log() {
  echo "`date`: $@" >> ~/Library/Logs/Lantern/installer.log
}

log "Configuring network services"
onOff=$1
url=$2
#port=$3
log "Setting to on or off: $onOff"
commandline=()
while read s;
do
    log "Configuring network: $s"
    commandline+=(-setautoproxyurl "${s}" "$url" -setautoproxystate "${s}" "${onOff}")
done < <(networksetup -listallnetworkservices | tail +2)
cleaned_commandline=`printf \""%s\" " "${commandline[@]}"`
networksetup "${commandline[@]}" || log "Could not configure network services; cmdline is $cleaned_commandline"
log "Done configuring network services!!"


{'fraction_non_alphanumeric': 0.15299334811529933, 'fraction_numerical': 0.005912786400591279, 'mean_word_length': 4.9126637554585155, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '639972', 'n_tokens_mistral': 475, 'n_tokens_neox': 469, 'n_words': 144}