Git Product home page Git Product logo

lua-sagemcom-openwrt's Introduction

lua-sagemcom-openwrt

OpenWRT Lua library for controlling Sagemcom routers.

Tested against the Bell Giga Hub 4000 (F@ST 5689E) firmware 1.19.6 (gui 7.3.28, guiapi 1.106).

Has basic error handling, but expects responses to be well-formed in general.

How to automatically disable radios on wan connection

  • Copy sagemcom.lua and sha2.lua to /usr/lib/lua.
  • Copy set_sagemcom_radios.lua to /usr/bin/set_sagemcom_radios.
  • opkg update && opkg install luci-lib-base luci-lib-httpclient and luci-lib-json.
  • Create /etc/hotplug.d/iface/90-sagemcom-radios (replace wan/admin/password with your values):
    #!/bin/sh
    [ "$ACTION" = "ifup" -a "$INTERFACE" = "wan" ] && {
      { set_sagemcom_radios 192.168.2.1 admin password off 2>&1 || echo exit status $? ; } | while read x
      do
        echo "(set_sagemcom_radios) $x" > /dev/kmsg
        echo "$x" | logger -t set_sagemcom_radios
      done
    }
    exit 0
  • chmod +x /usr/bin/set_sagemcom_radios /etc/hotplug.d/iface/90-sagemcom-radios
  • printf '%s\n' '' /usr/lib/lua/sagemcom.lua /usr/lib/lua/sha2.lua /usr/bin/set_sagemcom_radios /etc/hotplug.d/iface/90-sagemcom-radios >> /etc/sysupgrade.conf

lua-sagemcom-openwrt's People

Contributors

pgaskin avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.