From 397823a6d5e011b10eb528147aa44c4e5c2d812b Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Mon, 4 Mar 2019 12:49:14 -0500 Subject: [PATCH] improve docs --- libremanage | 18 +++++++++++------- libremanage-serial => old/libremanage-serial | 4 +++- libremanage-uncolor => old/libremanage-uncolor | 1 + 3 files changed, 15 insertions(+), 8 deletions(-) rename libremanage-serial => old/libremanage-serial (82%) mode change 100755 => 100644 rename libremanage-uncolor => old/libremanage-uncolor (99%) mode change 100755 => 100644 diff --git a/libremanage b/libremanage index 1653d2e..a7dcaaa 100755 --- a/libremanage +++ b/libremanage @@ -23,12 +23,15 @@ instead of CHANNEL and BOARD_ID. Note, the relay's channels default state when plugged in are off. -WARNING: If you lose access to the machine controlling a relay and a -relay channel is stuck on, you will need to manually replug usb power to -the relay so the channel goes back to its default off state before you -can turn on the server it is connected to, because its as if the servers -power button is stuck being held down. That is why this script runs -locally and ignores signals when its running. +WARNING: Avoid ever manually running "hidusb-relay-cmd on" in +production, because if you lose connectivity and can't turn it off, its +like the server's power button is stuck being pushed in and it won't +turn on in that state. You will need to physically replug usb power to +the relay so the channel goes back to its default off state. If this +script somehow dies after turning a relay on, running it again will turn +it off. That is why this script runs locally and ignores signals when +its running. If you run this script over ssh and lose connection as this +script is running, it will continue to run and complete. Example config: @@ -60,7 +63,8 @@ if [[ -e /etc/libremanage.conf ]]; then source /etc/libremanage.conf fi -# we know HOSTNAME is given if it doesn't start with a number. +# Use config vars. We know the arg is a HOSTNAME if it doesn't start +# with a number. if [[ $chan != [0-9]* ]]; then if [[ ! $board_id ]]; then board_id_var=${chan}_board_id diff --git a/libremanage-serial b/old/libremanage-serial old mode 100755 new mode 100644 similarity index 82% rename from libremanage-serial rename to old/libremanage-serial index f612725..60cacd9 --- a/libremanage-serial +++ b/old/libremanage-serial @@ -1,5 +1,7 @@ #!/bin/sh -# DO NOT USE. See README +echo DO NOT USE. See README +exit 1 + libremanage $1 tty-baud tmux new-session -d "bash -c 'libremanage $1 tty-read | libremanage-uncolor'" tmux split-window -h "libremanage $1 tty-write" diff --git a/libremanage-uncolor b/old/libremanage-uncolor old mode 100755 new mode 100644 similarity index 99% rename from libremanage-uncolor rename to old/libremanage-uncolor index a2ee1f7..2578459 --- a/libremanage-uncolor +++ b/old/libremanage-uncolor @@ -1,5 +1,6 @@ #!/usr/bin/env perl # DO NOT USE. See README + ## uncolor ? remove terminal escape sequences such as color changes ## Source: https://unix.stackexchange.com/questions/14684/removing-control-chars-including-console-codes-colours-from-script-output by Gilles while (<>) { -- 2.25.1