<commit_before>#!/bin/sh
set -v
set -e

if test $# -lt 1; then
    echo "usage: $0 <pid>"
    exit
fi

sudo ip link del veth0

ip link add name veth0 type veth peer name veth1
ip link set veth1 netns $1

ifconfig veth0 10.1.1.2 up
python attach.py $1 ifconfig veth1 10.1.1.1 up<commit_msg>Fix crash in network.sh if veth0 doesn't exist already<commit_after>#!/bin/sh
set -v
set -e

if test $# -lt 1; then
    echo "usage: $0 <pid>"
    exit
fi

sudo ip link del veth0 || true

ip link add name veth0 type veth peer name veth1
ip link set veth1 netns $1

ifconfig veth0 10.1.1.2 up
python attach.py $1 ifconfig veth1 10.1.1.1 up
{'fraction_non_alphanumeric': 0.09569377990430622, 'fraction_numerical': 0.06539074960127592, 'mean_word_length': 3.0256410256410255, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '2786909', 'n_tokens_mistral': 271, 'n_tokens_neox': 255, 'n_words': 104}