#!/bin/bash

# Start up a second SGW instance

SGW2_CUSTOM_CONF="/proj/PhantomNet/dual_sgw/sgw2.xml"

SUDO="/usr/bin/sudo"
OEPCPATH="/opt/OpenEPC"
OEPCETC="$OEPCPATH/etc"
OEPCBIN="$OEPCPATH/bin"

SGW2_CONF_PATH="sgw.xml"

if [ ! -e $SGW2_CUSTOM_CONF ]
then
	echo "Error: Unable to find second SGW config: $SGW2_CUSTOM_CONF"
	exit 1;
fi

$SUDO $OEPCBIN/check_oepc_config.pl -i $SGW2_CUSTOM_CONF $SGW2_CONF_PATH \
    || { echo "Could not install secondary SGW config file!" && exit 1; }

#$SUDO $OEPCBIN/run_wharf.pl sgw \
 #   || { echo "Could not start secondary SGW wharf process!" && exit 1; }

#echo "Second SGW wharf process started."
exit 0;
