<commit_before>--[[
    Copyright (C) 2016 Libre-Mesh.org

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along
    with this program; if not, write to the Free Software Foundation, Inc.,
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

    The full GNU General Public License is included in this distribution in
    the file called "COPYING".
--]]

-- Libre-Mesh.org config

require("luci.sys")
local lime = Map("lime", "Libre-Mesh")
local config = require("lime.config")

-- Create sections
local system = lime:section(NamedSection, "system", "lime","System","System")
system.addremove = false
local network = lime:section(NamedSection, "network", "lime","Network","Network")
network.addremove = false
local wifi = lime:section(NamedSection, "wifi","WiFi","WiFi")
wifi.addremove = false

-- hostname
local hostname = system:option(Value,"hostname",translate("Hostname"),
  translate("Name for this node"))
hostname.default = config.get("system","hostname")

-- network
local ipv4 = network:option(Value,"main_ipv4_address",translate("Main IPv4"),
  translate("The main IPv4 configured for this node, with slash notation (for ex. 1.2.3.4/24)"))
ipv4.default = config.get("network","main_ipv4_address")
ipv4.optional = true
local ipv6 = network:option(Value,"main_ipv6_address",translate("Main IPv6"),
  translate("The main IPv6 configured for this node, with slash notation (for ex. 2001:db8::1/64)"))
ipv6.default = config.get("network","main_ipv6_address")
ipv6.optional = true

-- wifi
local ap_ssid = wifi:option(Value,"ap_ssid",translate("Network SSID"),
  translate("Access Point ESSID (usually name of your network)"))
ap_ssid.default = config.get("wifi","ap_ssid")
ap_ssid.optional = true
local ch_2 = wifi:option(Value,"channel_2ghz",translate("Channel 2.4 GHz"),
  translate("Default channel used for 2.4 GHz radios"))
ch_2.default = config.get("wifi","channel_2ghz")
ch_2.optional = true
local ch_5 = wifi:option(Value,"channel_5ghz",translate("Channel 5 GHz"),
  translate("Default channel used for 5 GHz radios"))
ch_5.default = config.get("wifi","channel_5ghz")
ch_5.optional = true
local country = wifi:option(Value,"country",translate("Country code"),
  translate("Country code used for WiFi radios"))
country.default = config.get("wifi","country")
country.optional = true
local bssid = wifi:option(Value,"adhoc_bssid",translate("Mesh BSSID"),
  translate("The BSSID (WiFi network identifier) used for the mesh network"))
bssid.default = config.get("wifi","adhoc_bssid")
bssid.optional = true

-- commit
function lime.on_commit(self,map)
  luci.sys.call('(/usr/bin/lime-config > /tmp/lime-config.log 2>&1 && reload_config) &')
  luci.sys.call('((/etc/init.d/bmx6 restart &> /dev/null)&)')
end
<commit_msg>lime-webui: fallback to doing 'reboot' on Save & Apply, since 'reload_config' triggers bugs<commit_after>--[[
    Copyright (C) 2016 <EMAIL>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along
    with this program; if not, write to the Free Software Foundation, Inc.,
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

    The full GNU General Public License is included in this distribution in
    the file called "COPYING".
--]]

-- Libre-Mesh.org config

require("luci.sys")
local lime = Map("lime", "Libre-Mesh")
local config = require("lime.config")

-- Create sections
local system = lime:section(NamedSection, "system", "lime","System","System")
system.addremove = false
local network = lime:section(NamedSection, "network", "lime","Network","Network")
network.addremove = false
local wifi = lime:section(NamedSection, "wifi","WiFi","WiFi")
wifi.addremove = false

-- hostname
local hostname = system:option(Value,"hostname",translate("Hostname"),
  translate("Name for this node"))
hostname.default = config.get("system","hostname")

-- network
local ipv4 = network:option(Value,"main_ipv4_address",translate("Main IPv4"),
  translate("The main IPv4 configured for this node, with slash notation (for ex. 172.16.17.32/24)"))
ipv4.default = config.get("network","main_ipv4_address")
ipv4.optional = true
local ipv6 = network:option(Value,"main_ipv6_address",translate("Main IPv6"),
  translate("The main IPv6 configured for this node, with slash notation (for ex. 2001:db8::1/64)"))
ipv6.default = config.get("network","main_ipv6_address")
ipv6.optional = true

-- wifi
local ap_ssid = wifi:option(Value,"ap_ssid",translate("Network SSID"),
  translate("Access Point ESSID (usually name of your network)"))
ap_ssid.default = config.get("wifi","ap_ssid")
ap_ssid.optional = true
local ch_2 = wifi:option(Value,"channel_2ghz",translate("Channel 2.4 GHz"),
  translate("Default channel used for 2.4 GHz radios"))
ch_2.default = config.get("wifi","channel_2ghz")
ch_2.optional = true
local ch_5 = wifi:option(Value,"channel_5ghz",translate("Channel 5 GHz"),
  translate("Default channel used for 5 GHz radios"))
ch_5.default = config.get("wifi","channel_5ghz")
ch_5.optional = true
local country = wifi:option(Value,"country",translate("Country code"),
  translate("Country code used for WiFi radios"))
country.default = config.get("wifi","country")
country.optional = true
local bssid = wifi:option(Value,"adhoc_bssid",translate("Mesh BSSID"),
  translate("The BSSID (WiFi network identifier) used for the mesh network"))
bssid.default = config.get("wifi","adhoc_bssid")
bssid.optional = true

-- commit
function lime.on_commit(self,map)
  luci.sys.call('(/usr/bin/lime-config > /tmp/lime-config.log 2>&1 && reboot) &')
end

{'fraction_non_alphanumeric': 0.12696715049656226, 'fraction_numerical': 0.019862490450725745, 'mean_word_length': 5.234285714285714, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2484350', 'n_tokens_mistral': 2063, 'n_tokens_neox': 1968, 'n_words': 630}