#!/bin/bash
# V1

if [[ $EUID -ne 0 ]]; then
	echo "This script must be run as root" 
	exit 1
fi

killall -9 slattach
TEST=`/bin/ls /dev/ttyACM0`
while [ -z "$TEST" ]
do
	echo "Veuillez brancher un Arduino"
	sleep 5
done

slattach -L -s 9600 -p slip /dev/ttyACM0 &
ifconfig sl0 192.168.10.1 pointopoint 192.168.10.2
exit 0
