ModemReboot

ModemReboot

Docker app from agusalex' Repository

Overview

Puppeteer container for rebooting Modems on a schedule The specific navigation for your modem will vary, This is more of an example and isn't guaranteed to work for your particular modem. Check available scripts here: https://github.com/agusalex/modemReboot/ Add your scripts to the RebootModem folder and then set that myscripts/script.js in your SCRIPT env var Feel free to make a PR or add an issue here https://github.com/agusalex/modemReboot/issues to add your own modem's script If no CRON Env var is passed it will reboot upon first run and then quit

ModemReboot

Docker Hub package

Puppeteer container for rebooting Modems

  • Reboot your modem on a schedule using Cron.
  • The specific navigation for your modem will vary,
  • This is more of an example and isn't guaranteed to work for your particular modem.
  • Many thanks to https://github.com/mbierman 's post and https://stackoverflow.com/users/6870228/keith
  • Feel free to make a PR to add your own modem's script
  • If no CRON Env var is passed it will reboot upon first run and then quit

Modem List:

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.

Environmental Variables

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

Running

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

Configuring it for your own modem model

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

Tips

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/

Future Work

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

Install ModemReboot on Unraid in a few clicks.

Find ModemReboot in Community Apps on your Unraid server, review the template, and click Install. Unraid handles the Docker app or plugin setup from the published template.

Open the Apps tab on your Unraid server Search Community Apps for ModemReboot Review the template variables and paths Click Install

Download Statistics

2,890
Total Downloads

Related apps

Details

Repository
agusalex/modem_reboot
Last Updated2021-01-03
First Seen2020-10-07

Runtime arguments

Web UI
https://github.com/agusalex/modemReboot
Network
bridge
Shell
sh
Privileged
false

Template configuration

URLVariable

Container Variable: URL

Value
https://github.com/agusalex/modemReboot
USERVariable

Container Variable: USER

PASSVariable

Container Variable: PASS

CRONVariable

Container Variable: CRON

ScriptVariable

Container Variable: SCRIPT

Target
SCRIPT
UserScriptsPathrw

Container Path: /myscripts

Target
/myscripts
Value
/mnt/user/appdata/RebootModem