3 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
6 tmp
="$(readlink -f -- "$BASH_SOURCE")"; script_dir
=${tmp%/*}
9 git clone https
://vcs.fsf.org
/git
/usb-relay-hid.git
12 git remote add upstream-github https
://github.com
/pavel-a
/usb-relay-hid
13 git fetch upstream-github
14 if [[ $
(git rev-parse master
) != $
(git rev-parse upstream-github
/master
) ]]; then
15 echo "WARNING from iank! github https://github.com/pavel-a/usb-relay-hid is different from vcs master"
16 echo "sleeping 10 so you see this"
21 cd commandline
/makemake
/
23 apt-get
install libusb-dev libusb-1.0
-0-dev
25 cp $script_dir/libremanage hidusb-relay-cmd
/usr
/local
/bin
28 the output should be similar to this:
29 Board ID=[HURTM] State: R1=OFF R2=OFF
30 'HURTM' varies by board and goes into the libremanage config as the value for "relay"
33 if ! hidusb-relay-cmd state
; then
34 echo "$0: WARNING: running hidusb-relay-cmd state failed. this is expected if a relay is not plugged in" >&2