]> Pileus Git - ~andy/csm213a-hw/blob - hw2/install.sh
Work on second mbed
[~andy/csm213a-hw] / hw2 / install.sh
1 #!/bin/bash
2
3 function install
4 {
5         bin=$1
6         dev=$2
7         mnt=$3
8
9         if [ -b "$dev" ]; then
10                 echo "Installing: $bin -> $mnt"
11                 mount "$mnt"
12                 cp "$bin" "$mnt"
13                 umount "$mnt"
14         else
15                 echo Error: No USB found
16         fi
17 }
18
19 if [ -z "$1" ] || [ "$1" = "-h" ]; then
20         echo "usage: install.sh image.bin"
21         exit 0
22 fi
23
24 install "$1" /dev/sdb /mnt/mbed1 &
25 install "$1" /dev/sdc /mnt/mbed2 &
26
27 wait