forked from OpenRoberta/ora-cc-rsc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdateLejos.sh
executable file
·38 lines (31 loc) · 1.34 KB
/
updateLejos.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
echo 'updateLejos.sh <server-url> <lejos-version-0-or-1>'
echo ''
echo 'this script is used for low-level testing. Regular users get the updates for lejos from the official openroberta server'
serverUrl="$1"
lejosVersion="$2"
if [[ "$serverUrl" == '' ]]
then
echo 'the server URL is missing. Exit 12'
exit 12
elif [[ "$lejosVersion" == '' ]]
then
echo 'the lejos version (0 or 1) is missing. Exit 12'
exit 12
fi
lejosIpAddr='10.0.1.1'
run="scp -oKexAlgorithms=+diffie-hellman-group1-sha1 -c aes256-cbc RobotEV3/updateResources/lejos_${lejosVersion}/EV3Menu.jar root@${lejosIpAddr}:/home/root/lejos/bin/utils"
echo "executing: ${run}"
$run
run="echo ${serverUrl} | ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 -c aes256-cbc root@${lejosIpAddr} \"cat > /home/roberta/serverIP.txt\""
echo "executing: ${run}"
$run
run="ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 -c aes256-cbc root@${lejosIpAddr} mkdir -p /home/roberta/lib"
echo "executing: ${run}"
$run
runtime="RobotEV3/updateResources/lejos_${lejosVersion}/EV3Runtime.jar"
json="RobotEV3/updateResources/lejos_${lejosVersion}/json.jar"
websocket="RobotEV3/updateResources/lejos_${lejosVersion}/Java-WebSocket.jar"
run="scp -oKexAlgorithms=+diffie-hellman-group1-sha1 -c aes256-cbc ${runtime} ${json} ${websocket} root@${lejosIpAddr}:/home/roberta/lib"
echo "executing: ${run}"
$run