Controlling from the command line
---------------------------------
.. highlight:: console
Using curl
^^^^^^^^^^
.. index:: curl
`Curl `_ is a popular tool for fetching web pages that is available on a huge range of platforms.
To query the state of a device using curl::
# curl -u 'admin:555-0001' http://192.168.0.101/
Juiceboss unit 555-0001
Juiceboss unit 555-0001
Switch: 0
Voltage: 7.8
Uptime: 3
Firmware version: 501 2010/06/10
This is the local page for Juiceboss unit 555-0001. You can control this unit from anywhere, and add useful features, at http://juiceboss.com/555-0001
To turn the switch off::
# curl -u 'admin:555-0001' -d '' http://192.168.0.101/0
and on::
# curl -u 'admin:555-0001' -d '' http://192.168.0.101/1
Using wget
^^^^^^^^^^
.. index:: wget
`Wget `_ is a free software package for retrieving files. To get the status of the device::
# wget -q -O - --http-user=admin --http-password=555-0001 http://192.168.0.101/
To turn the switch off::
# wget -q -O - --http-user=admin --http-password=555-0001 --post-data='' http://192.168.0.101/0
To turn it on::
# wget -q -O - --http-user=admin --http-password=555-0001 --post-data='' http://192.168.0.101/1