#!/bin/bash
fullname=`which $0`
file=`basename $0`
ev3ext=${file##*.}

if [ "$ev3ext" == "$file" ]; then
 file=`readlink $fullname`
 ev3ext=${file##*.}
fi

if [[ $ev3ext == ssh ]]; then
 ev3cp="scp"
 ev3cphost="ev3"
 ev3sh="ssh"
 ev3shopt="-t"
 ev3shhost="ev3"
elif [[ $ev3ext == rsh ]]; then
 ev3cp="rcp"
 ev3cphost="robot@ev3dev.local"
 ev3sh="rsh"
 ev3shopt="-l robot"
 ev3shhost="ev3dev.local"
else 
 echo "Неизвестный способ доступа к EV3"
 exit 1
fi

export ev3ext ev3cp ev3cphost ev3sh ev3shopt ev3shhost

