#!/bin/sh myip=$(ip a|grep -o 'inet 10\.1\.1\.[0-9]\+'|cut -d ' ' -f 2) mypath=$(readlink --canonicalize $PWD/$(dirname $0)/../build/ppc/_compiled) if [ ! -d "$mypath" ]; then echo "$0: error: Cannot find $mypath" exit 1 fi if [ -z "$myip" ]; then echo "$0: error: You do not seem to be connected to the robot" echo "Your IP address should be 10.1.1.xxx" exit 1 fi set -x if ! grep -q $mypath /var/lib/nfs/etab; then sudo exportfs -o ro,no_subtree_check,no_root_squash 10.1.1.1:$mypath fi mount_point="/tmp/$USER@$myip" if [ "$1" = "-u" ]; then cmd="umount $mount_point" else cmd="mkdir -p $mount_point && mount -o nolock $myip:$mypath $mount_point" fi ssh root@10.1.1.1 $cmd if [ "$1" = "-c" ]; then ssh root@10.1.1.1 /home/bin/copy_from $mount_point fi