#!/bin/sh
# Create and bootstrap the new VPP development container
if [ "x$1" = "x" ]; then
  echo Need a new container name 
fi
CONTNAME=$1

echo PREP: launching a new container
lxc launch ubuntu:16.04 $CONTNAME
echo PREP: applying the correct profiles
lxc profile apply $CONTNAME default,hugepages,tuntap
sleep 5
echo PREP: restarting the container
lxc restart $CONTNAME
sleep 15
echo PREP: running the prepare script
lxc exec $CONTNAME -- su -l ubuntu -c "cp /shared/dot-ssh/* /home/ubuntu/.ssh"
lxc exec $CONTNAME -- su -l ubuntu -c "/shared/vpp-bootstrap $2 $3"



