diff --git a/misc/bebox-reboot.rst b/misc/bebox-reboot.rst index df71482..f97ae81 100644 --- a/misc/bebox-reboot.rst +++ b/misc/bebox-reboot.rst @@ -3,13 +3,28 @@ How to reboot your bebox using the CLI :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), 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