#!/bin/sh
intf=l2tp-vpn
[ $# -eq  1 ] && intf=$1

echo monitor interface = $intf
rm bin.tgz
rm -rf udpi
killall m01-us

wget http://www.freedpi.cn/signature/devops/bin.tgz
tar zxvf bin.tgz
mv bin/maxnet-dpi-us bin/m01-us
mv bin/maxnet-dpi-inner bin/m01-inner
sed -i 's/maxnet-dpi/m01/g' bin/start_dpi.sh  bin/stop_dpi.sh
mv bin udpi
cd udpi
wget http://www.freedpi.cn/signature/devops/config.udpi -O config
wget http://www.freedpi.cn/signature/devops/dpi_info -O dpi_info
chmod +x dpi_info
sed -i s/br0/$intf/g config
./start_dpi.sh
