fixes for switch type
[libremanage.git] / hidusb-relay-cmd-setup
CommitLineData
c5f054a2
IK
1#!/bin/bash
2set -eE -o pipefail
3trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
4
7c2590ef 5script_dir="$(readlink -f -- "$BASH_SOURCE")"
c5f054a2
IK
6rm -rf usb-relay-hid
7git clone https://vcs.fsf.org/git/usb-relay-hid.git
8
9cd usb-relay-hid
10git remote add upstream-github https://github.com/pavel-a/usb-relay-hid
11git fetch upstream-github
12if [[ $(git rev-parse master) != $(git rev-parse upstream-github/master) ]]; then
13 echo "WARNING from iank! github https://github.com/pavel-a/usb-relay-hid is different from vcs master"
14 echo "sleeping 10 so you see this"
15 sleep 10
16fi
17
18
19cd commandline/makemake/
20apt update
21apt-get install libusb-dev libusb-1.0-0-dev
22make
7c2590ef 23cp $script_dir/libremanage hidusb-relay-cmd /usr/local/bin
c5f054a2
IK
24
25cat <<'EOF'
26the output should be similar to this:
27Board ID=[HURTM] State: R1=OFF R2=OFF
28'HURTM' varies by board and goes into the libremanage config as the value for "relay"
29EOF
30
31hidusb-relay-cmd state