Add a CLI version to bebox.reboot.

This commit is contained in:
Alexis Metaireau 2010-10-21 14:30:00 +01:00
parent 5702c1c1ce
commit f6127d38bc

View file

@ -3,13 +3,28 @@ How to reboot your bebox using the CLI
:date: 2010-10-21 :date: 2010-10-21
I've an internet connection which , for some obscure reasons, tend to be very I've an internet connection which, for some obscure reasons, tend to be very
slow from time to time. After rebooting the box (yes, that's a hard solution), slow from time to time. After rebooting the box (yes, that's a hard solution),
all the things seems to go fine again. all the things seems to go fine again.
Well, that's not the optimal sulution, that's a bit "gruik", but it works. EDIT : Using grep
=================
If you have similar problems with yours, you can try this script: After a bit of reflexion, that's also really easy to do using directly the
command line tools curl, grep and tail (but really harder to read).
.. code-block:: bash
curl -X POST -u joel:joel
http://bebox.config/cgi/b/info/restart/\?be\=0\&l0\=1\&l1\=0\&tid\=RESTART -d
"0=17&2=`curl -u joel:joel
http://bebox.config/cgi/b/info/restart/\?be\=0\&l0\=1\&l1\=0\&tid\=RESTART |
grep -o "name='2' value='[0-9]\+" | grep -o "[0-9]\+" | tail -n 1`&1"
The Python version
==================
Well, that's not the optimal solution, that's a bit "gruik", but it works.
.. code-block:: python .. code-block:: python