Last active
March 10, 2022 20:55
-
-
Save candale/9851af503ea371f8120769731b2e1d5d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Note: this works with openbsd-netcat | |
echo "Serving powerstatusforever..." | |
while true; do | |
echo -ne "HTTP/1.0 200 OK\r\n\r\n$(cat /host-sys/class/power_supply/ACAD/online)" | nc -N -l -p 5555; | |
test $? -gt 0 && break; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment