Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not all OpenWRT versions use 3 lines for host definitions #3

Open
akhuraskin opened this issue Nov 12, 2021 · 1 comment
Open

Not all OpenWRT versions use 3 lines for host definitions #3

akhuraskin opened this issue Nov 12, 2021 · 1 comment

Comments

@akhuraskin
Copy link

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
@wongjustin99
Copy link

Need to make sure each line has a 'name' field as well. I have a bunch of leases without names in openwrt and this script doesn't like that as part of its validation.

Scanning static_leases.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. (dart:isolate-patch/isolate_patch.dart:281)
#9 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants