t11c-reset

command module
v0.0.0-...-89b553b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2020 License: MIT Imports: 1 Imported by: 0

README

t11c-reset

This command line tool provides a quick and easy way to force reconnect the modem on the Zyxel AMG1302-T11C ADSL wireless router. All interaction is carried out by forging HTTP requests made by the configuration UI.

Usage

Full usage instructions are available by running:

t11c-reset help

To immediately disconnect and reconnect the modem:

t11c-reset reconnect --username=admin --password=hunter2 --hostname=192.168.1.1

Configuration

Login credentials and the hostname may be provided via a YAML configuration file. The tool will attempt to automatically load from $HOME/.t11c-reset.yaml, if it exists.

username: AzureDiamond
password: hunter2
hostname: 192.168.1.1

Build

This project uses Go Modules, so compilation is extremely straightforward. Go 1.15 or a compatible release is required.

go build # By default will create the executable t11c-reset

SystemD Usage

To run as a service on a Linux machine, you can use the provided SystemD unit file in the systemd directory (supported by the majority of recent mainstream distributions).

To install, first install the built executable somewhere sensible on the machine, e.g.

sudo cp t11c-reset /usr/local/bin/t11c-reset

Then install the systemd unit file:

sudo cp systemd/t11c-reset.service /etc/systemd/system/t11c-reset.service
sudo chmod 644 /etc/systemd/system/t11c-reset.service

You should consider running the service as a non-privileged user.

And create a configuration file with the login details (or edit the unit file to configure via environment/command line):

# Create this file by hand. See the "Configuration" section above for details
sudo vim /usr/local/etc/t11c-reset.yaml

Finally, enable the service on boot, and start it:

sudo systemctl enable t11c-reset
sudo systemctl start t11c-reset

Once running, you can check the logs using journalctl:

journalctl -u t11c-reset -f

Documentation

Overview

Copyright © 2020 George Field <george@cucurbit.dev>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Directories

Path Synopsis
pkg
dom
net

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL