#!/bin/bash

if [[ $(id -u) -ne 0 ]] ; then 

#echo "no root"

if id -nG "$USER" | grep -qw "dialout"; then
  echo
else
     zenity --info --text "User '$USER' should be add to the group 'dialout' to use hardware ports.\n\n Please execute following command: sudo usermod -a -G dialout $USER"; 
    
fi	


 fi


cd /opt/junior


clear

CLASSPATH=""

ITEMS=`find -name *.jar`
for ITEM in $ITEMS; do
   CLASSPATH=$CLASSPATH:$ITEM
done

echo $CLASSPATH

#wmctrl -a "Flash"

/opt/junior/java/bin/java -classpath $CLASSPATH -Xmx256m scratchduino.robot.Main
