summaryrefslogtreecommitdiff
blob: 666ea47d9c9e0f45185a13b8a602fe89fbf9654e (plain)
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
42
#!/bin/sh

usage() {
  printf "The following firmware's are supported:\n"
  printf "Nordic Semiconductor Bootloader\n"
  printf "CrazyRadio Firmware\n"
  printf "RFStorm Research Firmware\n"
  printf "run \"mousejack install\"\n\n"
  printf "To flash Logitech Unifying Dongle C-U0007\n"
  printf "run \"mousejack logitech_install\"\n\n"
}

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

#parse args
while true; do
  case $1 in
    -h|--help)
      usage
      exit 0
      ;;
    install)
      /usr/share/mousejack/prog/usb-flash.py /usr/share/mousejack/dongle.bin
      exit $?
      ;;
    logitech_install)
      /usr/share/mousejack/prog/logitech-usb-flash.py /usr/share/mousejack/dongle.formatted.bin /usr/share/mousejack/dongle.formatted.ihx
      exit $?
      ;;
    --)
      shift
      break
      ;;
    *)
      break
      ;;
  esac
  shift
done