fix setup script
[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
ee2ef3ab
IK
5
6tmp="$(readlink -f -- "$BASH_SOURCE")"; script_dir=${tmp%/*}
7
c5f054a2
IK
8rm -rf usb-relay-hid
9git clone https://vcs.fsf.org/git/usb-relay-hid.git
10
11cd usb-relay-hid
12git remote add upstream-github https://github.com/pavel-a/usb-relay-hid
13git fetch upstream-github
14if [[ $(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
18fi
19
20
21cd commandline/makemake/
22apt update
23apt-get install libusb-dev libusb-1.0-0-dev
24make
7c2590ef 25cp $script_dir/libremanage hidusb-relay-cmd /usr/local/bin
c5f054a2
IK
26
27cat <<'EOF'
28the output should be similar to this:
29Board ID=[HURTM] State: R1=OFF R2=OFF
30'HURTM' varies by board and goes into the libremanage config as the value for "relay"
31EOF
32
33hidusb-relay-cmd state