Scripts for working with HS' laser from CLI
Go to file
woju 9bedcf58c5 Initial commit 2024-01-21 19:11:59 +01:00
README Initial commit 2024-01-21 19:11:59 +01:00
fan Initial commit 2024-01-21 19:11:59 +01:00
fan-off Initial commit 2024-01-21 19:11:59 +01:00
fan-on Initial commit 2024-01-21 19:11:59 +01:00
fan-query Initial commit 2024-01-21 19:11:59 +01:00
laser Initial commit 2024-01-21 19:11:59 +01:00
laser-force Initial commit 2024-01-21 19:11:59 +01:00
laser-query Initial commit 2024-01-21 19:11:59 +01:00
laser-release Initial commit 2024-01-21 19:11:59 +01:00
laser-take Initial commit 2024-01-21 19:11:59 +01:00

README

Installation
============

1. Install curl and jq.
2. Go to http://iot.waw.hackerspace.pl, login with "Trusted Network", then go
   to "admin" (in lower left), scroll to the very bottom and in the section
   "Long-Lived Access Tokens" click "Create token". Go through token creation
   flow and copy thit token to TOKEN= in `fan` script.
3. Copy (or symlink) everything apart from this README to /usr/local/bin or any
   directory in $PATH

Usage
=====

fan [query]
fan-query
    Check fan status. Will output "on" or "off".

fan on
fan-on
fan off
fan-off
    Toggle fan

laser [query]
laser-query
    Check who uses the laser. Will not output anything if laser is not taken.

laser take [<username>]
laser-take [<username>]
    Take the laser for 60 min. Works if no-one else uses laser. If you don't
    specify username, will use $USER environment variable.

laser release
laser-release
    Release the laser from usage. Works only if taken by you.

laser force
laser-force
    Force release the laser. Works whether you took the laser or someone else.
    This is for use only if you took the laser, then disconnected and got
    another IP address from DHCP.