<commit_before>#!/bin/sh

if [ ! -x `which fetch` ];then
    echo "no fetch found, I think databeestje lost that part"
    exit 0
fi

baseurl='http://pfsense.com/cgi-bin/cvsweb.cgi/pfSense'
urlrev='?rev='
urlcon=';content-type=text%2Fplain'
rev='1'

if [ -z $1 ];then
    echo "No file to update given"
    echo "Usage: `basename $0` /path/to/file [revision]"
    echo "Usage: `basename $0` -all"
    exit 0
fi

if [ "$1" = "-all" ];then
    echo "This will update all .php .js and .inc pages on your pfsense box!"
    FMATCHES=`find /etc/inc/ /usr/local/www /usr/local/captiveportal -name "*.php" -or -name "*.inc" -or -name "*.js"`
elif [ ! -f $1 ];then
    echo "File $1 doesn't exist"
    exit 0
else
    FMATCHES=$1
fi

/etc/rc.conf_mount_rw

for file in $FMATCHES ;do

    if [ ! -z $2 ];then
        rev=$2
        echo "trying to fetch $rev $file"
    else
        echo "trying to fetch latest $file"
    fi
    
    /usr/bin/fetch -T 60 -q -o "$file" "$baseurl$file$urlrev$rev$urlcon"

    if [ $? -eq 0 ]; then
            echo "File updated."
        else
            echo "An error occured during update."
    fi

done

/etc/rc.conf_mount_ro

<commit_msg>Mount image r/w earlier in the process<commit_after>#!/bin/sh

if [ ! -x `which fetch` ];then
    echo "no fetch found, I think databeestje lost that part"
    exit 0
fi

baseurl='http://pfsense.com/cgi-bin/cvsweb.cgi/pfSense'
urlrev='?rev='
urlcon=';content-type=text%2Fplain'
rev='1'

if [ -z $1 ];then
    echo "No file to update given"
    echo "Usage: `basename $0` /path/to/file [revision]"
    echo "Usage: `basename $0` -all"
    exit 0
fi

/etc/rc.conf_mount_rw

if [ "$1" = "-all" ];then
    echo "This will update all .php .js and .inc pages on your pfsense box!"
    FMATCHES=`find /etc/inc/ /usr/local/www /usr/local/captiveportal -name "*.php" -or -name "*.inc" -or -name "*.js"`
elif [ ! -f $1 ];then
    echo "File $1 doesn't exist"
    exit 0
else
    FMATCHES=$1
fi

for file in $FMATCHES ;do

    if [ ! -z $2 ];then
        rev=$2
        echo "trying to fetch $rev $file"
    else
        echo "trying to fetch latest $file"
    fi
    
    /usr/bin/fetch -T 60 -q -o "$file" "$baseurl$file$urlrev$rev$urlcon"

    if [ $? -eq 0 ]; then
            echo "File updated."
        else
            echo "An error occured during update."
    fi

done

/etc/rc.conf_mount_ro


{'fraction_non_alphanumeric': 0.15048749470114456, 'fraction_numerical': 0.014412886816447647, 'mean_word_length': 2.3618233618233617, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5280130', 'n_tokens_mistral': 937, 'n_tokens_neox': 895, 'n_words': 286}