mirror of
https://github.com/almet/notmyidea.git
synced 2025-04-28 11:32:39 +02:00
Add a CLI version to bebox.reboot.
This commit is contained in:
parent
5702c1c1ce
commit
f6127d38bc
1 changed files with 18 additions and 3 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue