<commit_before>#!/bin/bash

source /etc/mlab/slice-functions
source $SLICEHOME/conf/config.sh

set -e

# NOTE: update configuration specific to this node.
if ! test -f $SLICEHOME/.yumdone ; then 
    yum install -y nmap pdns pdns-backend-pipe bind-utils
    # NOTE: if there was an error installing, 'set -e' would stop us.
    # NOTE: so signal success.
    touch $SLICEHOME/.yumdone
fi
yum update -y

# setup pdns 
cp /etc/pdns/pdns.conf /etc/pdns/pdns.conf.bak
cp $SLICEHOME/conf/pdns.conf /etc/pdns/pdns.conf
cp $SLICEHOME/resolve-by-mlabns.py /usr/sbin/
chkconfig pdns on
service pdns start

# rsync
sed -e "s;RSYNCDIR_FATHOM;/var/spool/$SLICENAME/$RSYNCDIR_FATHOM;" \
  $SLICEHOME/conf/rsyncd.conf.in > /etc/rsyncd.conf
mkdir -p /var/spool/$SLICENAME/$RSYNCDIR_FATHOM
chown -R $SLICENAME:slices /var/spool/$SLICENAME/$RSYNCDIR_FATHOM
service rsyncd restart<commit_msg>conditional setup for some servers<commit_after>#!/bin/bash

source /etc/mlab/slice-functions
source $SLICEHOME/conf/config.sh

set -e
HOSTNAME=`hostname`
ENABLE_DONAR=
if grep -q $HOSTNAME $SLICEHOME/conf/donar.txt ; then
    ENABLE_DONAR="yes"
fi

# NOTE: update configuration specific to this node.
if ! test -f $SLICEHOME/.yumdone ; then 
    if test x"$ENABLE_DONAR" = x"yes" ; then
        yum install -y nmap pdns pdns-backend-pipe bind-utils
    else
        yum install -y nmap 
    fi
    # NOTE: if there was an error installing, 'set -e' would stop us.
    # NOTE: so signal success.
    touch $SLICEHOME/.yumdone
fi
yum update -y

if test x"$ENABLE_DONAR" = x"yes" ; then
    # setup pdns 
    cp /etc/pdns/pdns.conf /etc/pdns/pdns.conf.bak
    cp $SLICEHOME/conf/pdns.conf /etc/pdns/pdns.conf
    cp $SLICEHOME/resolve-by-mlabns.py /usr/sbin/
    chkconfig pdns on
    service pdns start
fi

# rsync
sed -e "s;RSYNCDIR_FATHOM;/var/spool/$SLICENAME/$RSYNCDIR_FATHOM;" \
  $SLICEHOME/conf/rsyncd.conf.in > /etc/rsyncd.conf
mkdir -p /var/spool/$SLICENAME/$RSYNCDIR_FATHOM
chown -R $SLICENAME:slices /var/spool/$SLICENAME/$RSYNCDIR_FATHOM
service rsyncd restart
{'fraction_non_alphanumeric': 0.1198044009779951, 'fraction_numerical': 0.0, 'mean_word_length': 3.4190064794816415, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4395662', 'n_tokens_mistral': 839, 'n_tokens_neox': 812, 'n_words': 192}