fix(powerman): use -h flag for remote server in query script
Debian's powerman client uses the -h/--server-host flag, not the
POWERMAN_SERVER env var, to connect to a remote daemon. Update query-remote.sh
to pass -h explicitly.
💘 Generated with Crush
Assisted-by: Crush:glm-5.2
This commit is contained in:
@@ -47,19 +47,19 @@ export POWERMAN_SERVER="${REMOTE_HOST}:${REMOTE_PORT}"
|
|||||||
# --- 3. List outlets ---
|
# --- 3. List outlets ---
|
||||||
echo ""
|
echo ""
|
||||||
echo "--- Outlets ---"
|
echo "--- Outlets ---"
|
||||||
powerman -l
|
powerman -h "${REMOTE_HOST}:${REMOTE_PORT}" -l
|
||||||
|
|
||||||
# --- 4. Query status ---
|
# --- 4. Query status ---
|
||||||
echo ""
|
echo ""
|
||||||
echo "--- Status ---"
|
echo "--- Status ---"
|
||||||
powerman -q
|
powerman -h "${REMOTE_HOST}:${REMOTE_PORT}" -q
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "============================================"
|
echo "============================================"
|
||||||
echo " Done."
|
echo " Done."
|
||||||
echo ""
|
echo ""
|
||||||
echo " To control an outlet from this workstation:"
|
echo " To control an outlet from this workstation:"
|
||||||
echo " POWERMAN_SERVER=${REMOTE_HOST}:${REMOTE_PORT} powerman -0 outlet-10 # off"
|
echo " powerman -h ${REMOTE_HOST}:${REMOTE_PORT} -0 outlet-10 # off"
|
||||||
echo " POWERMAN_SERVER=${REMOTE_HOST}:${REMOTE_PORT} powerman -1 outlet-10 # on"
|
echo " powerman -h ${REMOTE_HOST}:${REMOTE_PORT} -1 outlet-10 # on"
|
||||||
echo " POWERMAN_SERVER=${REMOTE_HOST}:${REMOTE_PORT} powerman -c outlet-10 # cycle"
|
echo " powerman -h ${REMOTE_HOST}:${REMOTE_PORT} -c outlet-10 # cycle"
|
||||||
echo "============================================"
|
echo "============================================"
|
||||||
|
|||||||
Reference in New Issue
Block a user