Extra bad olsr protection (#992)

* Better protection for missing olsrd files
This commit is contained in:
Tim Wilkinson 2023-12-06 12:24:43 -08:00 committed by GitHub
parent da8ef31dd1
commit 6d15dfb869
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 43 additions and 39 deletions

View File

@ -1 +1 @@
src-git arednpackages https://github.com/aredn/aredn_packages;develop src-git arednpackages https://github.com/kn6plv/aredn_packages;working

View File

@ -70,6 +70,7 @@ function do_namechange()
local subdomains = "" local subdomains = ""
-- Load the hosts file -- Load the hosts file
if nixio.fs.stat("/var/run/hosts_olsr.stable") then
for line in io.lines("/var/run/hosts_olsr.stable") for line in io.lines("/var/run/hosts_olsr.stable")
do do
local v = line:splitWhiteSpace() local v = line:splitWhiteSpace()
@ -93,6 +94,7 @@ function do_namechange()
end end
end end
end end
end
-- Find the current neighbors -- Find the current neighbors
local raw = io.popen("/usr/bin/wget -O - http://127.0.0.1:9090/links 2> /dev/null") local raw = io.popen("/usr/bin/wget -O - http://127.0.0.1:9090/links 2> /dev/null")

View File

@ -312,6 +312,7 @@ end
-- discard -- discard
routes = nil routes = nil
if nixio.fs.stat("/var/run/services_olsr") then
for line in io.lines("/var/run/services_olsr") for line in io.lines("/var/run/services_olsr")
do do
if line:match("^%w") then if line:match("^%w") then
@ -339,6 +340,7 @@ do
end end
end end
end end
end
-- load the node history -- load the node history
if nixio.fs.stat("/tmp/node.history") then if nixio.fs.stat("/tmp/node.history") then