<commit_before>#!/bin/bash

# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then
   echo "You need to be 'root' dude." 1>&2
   exit 1
fi

clear

# source the setup file
. ./setuprc

# variables
rignic=$SG_SERVICE_CONTROLLER_NIC

# install netaddr and radvd
apt-get install -y python-netaddr
apt-get install -y radvd

# hack up the nova.conf file
sed -e "
/^use_ipv6=.*$/s/^.*$/enable_ipv6=True/
" -i /etc/nova/nova.conf

# set the routing flags correctly
echo 0 > /proc/sys/net/ipv6/conf/$rignic/forwarding # default value is 1
echo 1 > /proc/sys/net/ipv6/conf/$rignic/accept_ra # default value is 2
echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
echo 1 > /proc/sys/net/ipv6/conf/all/accept_ra
echo 1 > /proc/sys/net/ipv6/conf/default/accept_ra
echo 0 > /proc/sys/net/ipv6/conf/br100/forwarding
echo 1 > /proc/sys/net/ipv6/conf/br100/accept_ra

# build a file for reboot + janky patch for OpenStack networking foobaring things
cat > /etc/init.d/ipv6-setup <<EOF
echo 0 > /proc/sys/net/ipv6/conf/$rignic/forwarding
echo 1 > /proc/sys/net/ipv6/conf/$rignic/accept_ra<commit_msg>Differentiate between compute and controller rigs<commit_after>#!/bin/bash

# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then
   echo "You need to be 'root' dude." 1>&2
   exit 1
fi

clear

# source the setup file
. ./setuprc

# variables based on rig type
if [[ -z $SG_SERVICE_CONTROLLER ]]; then
  rignic=$SG_SERVICE_COMPUTE_NIC
else
  rignic=$SG_SERVICE_CONTROLLER_NIC
fi

# install netaddr and radvd
apt-get install -y python-netaddr
apt-get install -y radvd

# hack up the nova.conf file
sed -e "
/^use_ipv6=.*$/s/^.*$/enable_ipv6=True/
" -i /etc/nova/nova.conf

# set the routing flags correctly
echo 0 > /proc/sys/net/ipv6/conf/$rignic/forwarding # default value is 1
echo 1 > /proc/sys/net/ipv6/conf/$rignic/accept_ra # default value is 2
echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
echo 1 > /proc/sys/net/ipv6/conf/all/accept_ra
echo 1 > /proc/sys/net/ipv6/conf/default/accept_ra
echo 0 > /proc/sys/net/ipv6/conf/br100/forwarding
echo 1 > /proc/sys/net/ipv6/conf/br100/accept_ra

# build a file for reboot + janky patch for OpenStack networking foobaring things
cat > /etc/init.d/ipv6-setup <<EOF
echo 0 > /proc/sys/net/ipv6/conf/$rignic/forwarding
echo 1 > /proc/sys/net/ipv6/conf/$rignic/accept_ra
{'fraction_non_alphanumeric': 0.1369098712446352, 'fraction_numerical': 0.02832618025751073, 'mean_word_length': 3.570588235294118, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 25, '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': '6480872', 'n_tokens_mistral': 951, 'n_tokens_neox': 928, 'n_words': 235}