aboutsummaryrefslogtreecommitdiffhomepage
path: root/contrib/nxt-update-firmware
blob: 60f4340016703f70685db2c0d949836734bff4b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

pathfind() {
    OLDIFS="$IFS"
    IFS=:
    for p in $PATH; do
        if [ -x "$p/$*" ]; then
            IFS="$OLDIFS"
            return 0
        fi
    done
    IFS="$OLDIFS"
    return 1
}

if ! pathfind fwflash; then
	echo You need to install the libnxt package to flash firmware to NXT bricks. >&2
	exit 1
fi

fwflash /usr/share/nxt-firmware/nxt_firmware.bin