-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lime-hwd-eth1-wan: generalized as lime-hwd-openwrt-wan
lime-system: make a backup of original configuration at first boot lime-hwd-tl_wdr3600: do not take charge of wan/lan configuration as lime-hwd-openwrt-wan does it lime-full: depends on lime-hwd-openwrt-wan instead of lime-hwd-eth1-wan
- Loading branch information
Showing
7 changed files
with
49 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/lua | ||
|
||
local libuci = require("uci") | ||
local hardware_detection = require("lime.hardware_detection") | ||
|
||
local openwrt_wan = {} | ||
|
||
openwrt_wan.sectionName = hardware_detection.sectionNamePrefix.."openwrt_wan" | ||
|
||
function openwrt_wan.clean() | ||
if config.autogenerable(openwrt_wan.sectionName) then config.delete(openwrt_wan.sectionName) end | ||
end | ||
|
||
function openwrt_wan.detect_hardware() | ||
if config.autogenerable(openwrt_wan.sectionName) then | ||
local uci_o = libuci:cursor() | ||
uci_o:set_confdir("/etc/lime/config.original") | ||
uci_o:set_savedir("/dev/null") | ||
local ifname = uci_o:get("network", "wan", "ifname") | ||
uci_o = nil | ||
if ifname then | ||
local protos = {} | ||
for _, proto in pairs(config.get("network", "protocols")) do | ||
if ( ( proto ~= "lan" ) and ( proto ~= "wan" ) ) then | ||
table.insert(protos, proto) | ||
end | ||
end | ||
table.insert(protos, "wan") | ||
|
||
config.init_batch() | ||
config.set(openwrt_wan.sectionName, "net") | ||
config.set(openwrt_wan.sectionName, "autogenerated", "true") | ||
config.set(openwrt_wan.sectionName, "protocols", protos) | ||
config.set(openwrt_wan.sectionName, "linux_name", ifname) | ||
config.end_batch() | ||
end | ||
end | ||
end | ||
|
||
|
||
return openwrt_wan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/bin/sh | ||
echo "Configuring LiMe for first time, will take apprex 2 minutes..." | ||
(sleep 90s ; lua /usr/bin/lime-config && uci commit && reboot)&); | ||
(sleep 90s ; cp -r /etc/config /etc/lime/config.original ; lua /usr/bin/lime-config && uci commit && reboot)&); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters