geekvisit / uproot Goto Github PK
View Code? Open in Web Editor NEWA tool to migrate static leases between routers
A tool to migrate static leases between routers
Just found your great tool.. wondering if it would be easy to add an option that doesn't require a fully qualified host name (with domain).
eg don't reject "router" and only accept "router.domain.com"
Great software!
Using the example REAME.md writeup to export & convert the static leases for an OpenWRT router caused the utility to exit abnormally with error messages.
Incorrect syntax: grep -hnr -A3 "config host" /etc/config/dhcp > static_leases.openwrt
Suggest to change this to: cat /etc/config/dhcp > static_leases.openwrt
Version:
uprt (2021.10.001 running on windows "Windows 10 Pro" 10.0 (Build 19043))
I exported openwrt leases using
grep -hnr -A4 "config host" /etc/config/dhcp
My configuration contains entries with duid
in addition to mac
such as this one:
115:config host
116- option mac 'FC:44:82:AA:AA:AA'
117- option dns '1'
118- option duid '000100012774439a540xxxxxxxxx'
119- option ip '192.168.1.244'
They crash uproot. If I remove these entries, export finishes fine.
Error output:
> .\uprt.exe .\duid.openwrt -g j
Uprt converting files ...
Scanning duid.openwrt...
Error:#0 _GrowableList.[] (dart:core-patch/growable_array.dart:254)
#1 ValidateLeases.removeBadLeases (package:uprt/src/validate_leases.dart:175)
#2 OpenWrt.getLeaseMap (package:uprt/src/open_wrt.dart:124)
#3 Converter.getSourceLeaseMap (package:uprt/src/converter.dart:228)
#4 Converter.toJson (package:uprt/src/converter.dart:260)
#5 Converter.toOutput (package:uprt/src/converter.dart:70)
#6 Converter.convertFileList (package:uprt/src/converter.dart:29)
#7 main (file:///g:/users/david/documents/mega/projects/dart/convert-ddwrt/cli/bin/uprt.dart:74)
#8 _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:281)
#9 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184)
Keeping 3 lines after config host
is not enough for some versions of OpenWRT. For OpenWrt SNAPSHOT r12235-49caf9f98a
, /etc/config/dhcp
contains at least 4 lines for each host config. As a result, OpenWRT export instructions don't work for these configurations. Changing 3 to 4 fixes the issue in my case, but I'm not sure if this will work for everybody:
grep -hnr -A4 "config host" /etc/config/dhcp > static_leases.openwrt
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.