Commit | Line | Data |
---|---|---|
c5f054a2 IK |
1 | #!/bin/bash |
2 | set -eE -o pipefail | |
3 | trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR | |
4 | ||
ee2ef3ab IK |
5 | |
6 | tmp="$(readlink -f -- "$BASH_SOURCE")"; script_dir=${tmp%/*} | |
7 | ||
c5f054a2 IK |
8 | rm -rf usb-relay-hid |
9 | git clone https://vcs.fsf.org/git/usb-relay-hid.git | |
10 | ||
11 | cd usb-relay-hid | |
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" | |
17 | sleep 10 | |
18 | fi | |
19 | ||
20 | ||
21 | cd commandline/makemake/ | |
22 | apt update | |
23 | apt-get install libusb-dev libusb-1.0-0-dev | |
24 | make | |
7c2590ef | 25 | cp $script_dir/libremanage hidusb-relay-cmd /usr/local/bin |
c5f054a2 IK |
26 | |
27 | cat <<'EOF' | |
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" | |
31 | EOF | |
32 | ||
33 | hidusb-relay-cmd state |