#!/bin/bash

if [ -z $1 ]
then
        echo "Missing commandline argument!"
        echo "Usage: $(basename $0) <p4-program-name>"
        echo "Example: $(basename $0) l2switch"
        exit -1
fi

DEFAULT_PROG=$1
P4RTDIR="/root/bmv2/bin"

echo "Launching P4Runtime-shell..."

PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python python3 -m p4runtime_sh --grpc-addr localhost:50051 --device-id 0 --election-id 0,1 --config "${P4RTDIR}/${DEFAULT_PROG}.p4info.txt,${P4RTDIR}/${DEFAULT_PROG}.json"

