#!/bin/bash
#
#File: ntt.sh (Network test script)
#VPN install and auto connect
#Company: CASSTK Co., LTD.
#Author: David Chu
#Date: 2016-07-28
#
#Reference Code
#Test all pc is online
#
#ip="192.168.3."
#for i in `seq 1 254`
#do
#  ping -c 2 $ip$i | grep -q 'ttl=' && echo "$ip$i yes"|| echo "$ip$i no"
#
#done

eth='ppp0'

vpnfile='vpn'

VPN=`sudo ifconfig | grep $eth`

#sudo route add -net 192.168.100.0 netmask 255.255.255.0 dev $eth
sudo route add -net 192.168.100.0 netmask 255.255.255.0 dev $eth

if [ -z "$VPN" ]
then
    sudo pon $vpnfile
fi
