update-packet-exchange 585 Bytes
Newer Older
Joanne Hugé's avatar
Joanne Hugé committed
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 39 40 41
#!/bin/bash

usage() {
  echo "Usage: $0 [-h] DEVICE"
  exit 1;
}

board_rt_measures_dir="mnt_sd/home/oli/rt-measures"
git_root_dir="../.."

while getopts "hdkmi:" opt; do
  case "${opt}" in
    h )
        usage
        ;;
    * )
        usage
      ;;
  esac
done

shift $((OPTIND-1))

if [ -z "$1" ]; then
  usage
fi

device=$1

rm -rf mnt_sd;
mkdir -p mnt_sd;

mount ${device}2 mnt_sd;

rm -rf $board_rt_measures_dir/packet-exchange;
cp -r $git_root_dir/packet-exchange $board_rt_measures_dir/;
cp -r $git_root_dir/scripts $board_rt_measures_dir/;

umount mnt_sd;
rm -rf mnt_sd;