{
- "servers": {
- "web2": {
- "manager": "myboard",
- "tty": {
- "uncolor": true,
- "file": "/dev/ttyUSB0",
- "baud": 115200
- },
- "power": {
- "type": "hidusb-relay-cmd",
- "relay": "HURTM",
- "channel": 2
- }
- }
- },
- "managers": {
- "myboard": {
- "host": "192.168.0.250",
- "port": 22,
- "username": "root"
- }
+ "servers": {
+ "web2": {
+ "manager": "myboard",
+ "tty": {
+ "uncolor": false,
+ "file": "/dev/ttyUSB0",
+ "baud": 115200
+ },
+ "power": {
+ "type": "hidusb-relay-cmd",
+ "relay": "HURTM",
+ "channel": 2
+ }
}
+ },
+ "managers": {
+ "myboard": {
+ "host": "192.168.0.250",
+ "port": 22,
+ "username": "root"
+ }
+ }
}
-
--- /dev/null
+#!/bin/bash
+set -eE -o pipefail
+trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
+
+rm -rf usb-relay-hid
+git clone https://vcs.fsf.org/git/usb-relay-hid.git
+
+cd usb-relay-hid
+git remote add upstream-github https://github.com/pavel-a/usb-relay-hid
+git fetch upstream-github
+if [[ $(git rev-parse master) != $(git rev-parse upstream-github/master) ]]; then
+ echo "WARNING from iank! github https://github.com/pavel-a/usb-relay-hid is different from vcs master"
+ echo "sleeping 10 so you see this"
+ sleep 10
+fi
+
+
+cd commandline/makemake/
+apt update
+apt-get install libusb-dev libusb-1.0-0-dev
+make
+cp hidusb-relay-cmd /usr/local/bin
+
+cat <<'EOF'
+the output should be similar to this:
+Board ID=[HURTM] State: R1=OFF R2=OFF
+'HURTM' varies by board and goes into the libremanage config as the value for "relay"
+EOF
+
+hidusb-relay-cmd state
- shutdown, reboot, poweron: Power management
- tty: Open TTY in GNU Screen
- - sanity, sanity-sh: SSH sanity tests, ignore
+ - sanity, sanity-sh: SSH sanity tests, which will whoami or just run sh.
Define a configuration file in ~/.libremanage.json. See the included
config.json for an example. Servers correspond to managed servers; managers
+++ /dev/null
-git clone https://github.com/pavel-a/usb-relay-hid
-cd usb-relay-hid/
-cd commandline/
-cd makemake/
-apt update
-sudo apt install libusb-dev
-sudo apt install libusb-1.0-0-dev
-cp hidusb-relay-cmd /usr/local/bin
-make -j4
-hidusb-relay-cmd state