Reboot modem on a schedule using puppeteer, add your script for your own make and model.
3.7K
Puppeteer container for rebooting Modems
Set this as your SCRIPT Env var
| Modem | SCRIPT |
|---|---|
| Technicolor CGA4233TCH3 modem (Fibertel) | example.js |
| Arris (Modem Undefined) | arris.js |
| Mitrastar 2541GNA (Movistar) | Movistar_Mitrastar_2541GNAC.js |
| ZTE_MF258 | ZTE_MF258.js |
By default will run example.js you can change that by setting SCRIPT parameter.
| Variable | Description |
|---|---|
| URL | Modem URL (for example http://192.168.0.1/ ) |
| USER | Modem USER |
| PASS | Modem Password |
| SCRIPT | Modem Model js Script |
| CRON | Cron Schedule |
If your modem is already supported, run this container with these ENV options :
docker run -it -e URL=URL -e USER=USER -e PASS=PASS -e SCRIPT=yourModem.js -e CRON="* * * * *" agusalex/modemReboot
Otherwise see the next section
To debug with your particular modem first install nodeJs then install dependencies:
npm install puppeteer date-and-time is-docker
And run it:
node app.js
Finally when you have it ready, make a PR or create an Issue with your script and I will add it.
If you want to build your own docker container thats easy too:
docker build -t "myModemRebooter" .
docker run -it -e URL=URL -e USER=USER -e PASS=PASS -e SCRIPT=yourModem.js -e CRON="* * * * *" myModemRebooter
Open the developer tools in the browser, inspect element click it and get the ID then you can use it.
For example login-button is the id of the button:
const form = await page.$('#login-button');
await form.evaluate( form => form.click() );
If the element does not have an ID, after inspecting it right click on the DOM of the element and select Copy Selector
Then you can use it like so:
cpage.click( "OUTPUT FROM COPY SELECTOR" )
More info in https://pptr.dev/
In order for this to be usefull we need as many Modem models scripts as possible, this cant be done without the help of others
Content type
Image
Digest
Size
225.9 MB
Last updated
over 5 years ago
docker pull agusalex/modem_reboot