SWITCH
Last updated
Last updated
The SWITCH
command returns the current position of the sliding switch.
Advanced payloads can use this to determine user input.
This does not necessarily reflect the switch position when the Packet Squirrel was booted, only the current position of the switch.
When called with a timeout, the SWITCH
script will return the position of the switch (switch1
through switch4
).
To learn how to write payloads which can handle responses, check the Advanced Bash section!
You can experiment using the SWITCH
command live, either in the Web Shell in the web UI, or via ssh
!
Payloads using the SWITCH
command must handle the output; for example the following payload sets the LED based on the switch position. For more information about writing advanced payloads, see the Advanced Bash section!