you are interested.
relay-cmd is a simple script config to use the relay from the device its
-connected to. NOT YET TESTED.
+connected to.
libremanage is an overly complicated command that is deprecated. Some
problems with it:
cephserver2_channel=2
cephserver2_relay_id=HURTM
EOF
- exit $1
}
# we know HOSTNAME is given if it doesn't start with a number.
if [[ $chan != [0-9]* ]]; then
+ if [[ ! $relay_id ]]; then
+ relay_id_var=${chan}_relay_id
+ relay_id=${!relay_id_var}
+ fi
chan_var=${chan}_channel
chan=${!chan_var}
+
if [[ ! $chan ]]; then
echo "error: channel not found in /etc/relay-cmd.conf" >&2
exit 1
fi
- if [[ ! $relay_id ]]; then
- relay_id_var=${chan}_relay_id
- relay=${!relay_id_var}
- fi
fi
# verbose command
v() {
- printf "+ %s\n" "$*"
+ printf "$0 running: %s\n" "$*"
"$@"
}
# ignore hup so we complete even if there is a connection problem.
trap '' HUP
-echo "$0: doing $action. shell commands are printed to the terminal:"
+echo "$0: doing $action. shell commands will be printed to the terminal."
case $action in
poweroff)
v hidusb-relay-cmd $relay_id_arg on $chan