projects
/
libremanage.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix install script from returning false error
[libremanage.git]
/
hidusb-relay-cmd-setup
diff --git
a/hidusb-relay-cmd-setup
b/hidusb-relay-cmd-setup
index 73ac1fc85f6a659d535535552d248c73cab8a50c..e63b0619136526805b1b64066c91f8db116e8c6f 100755
(executable)
--- a/
hidusb-relay-cmd-setup
+++ b/
hidusb-relay-cmd-setup
@@
-2,6
+2,9
@@
set -eE -o pipefail
trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
set -eE -o pipefail
trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
+
+tmp="$(readlink -f -- "$BASH_SOURCE")"; script_dir=${tmp%/*}
+
rm -rf usb-relay-hid
git clone https://vcs.fsf.org/git/usb-relay-hid.git
rm -rf usb-relay-hid
git clone https://vcs.fsf.org/git/usb-relay-hid.git
@@
-19,7
+22,7
@@
cd commandline/makemake/
apt update
apt-get install libusb-dev libusb-1.0-0-dev
make
apt update
apt-get install libusb-dev libusb-1.0-0-dev
make
-cp hidusb-relay-cmd /usr/local/bin
+cp
$script_dir/libremanage
hidusb-relay-cmd /usr/local/bin
cat <<'EOF'
the output should be similar to this:
cat <<'EOF'
the output should be similar to this:
@@
-27,4
+30,6
@@
Board ID=[HURTM] State: R1=OFF R2=OFF
'HURTM' varies by board and goes into the libremanage config as the value for "relay"
EOF
'HURTM' varies by board and goes into the libremanage config as the value for "relay"
EOF
-hidusb-relay-cmd state
+if ! hidusb-relay-cmd state; then
+ echo "$0: WARNING: running hidusb-relay-cmd state failed. this is expected if a relay is not plugged in" >&2
+fi