Show
Ignore:
Timestamp:
11/18/10 20:53:33 (3 years ago)
Author:
soma
Message:

modules/freifunk: Fix ff_mapupdate and close #128

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • luci/trunk/modules/freifunk/root/usr/sbin/ff_mapupdate

    r4599 r6510  
    11#!/usr/bin/lua 
    22 
     3require("luci.fs") 
    34local uci = require "luci.model.uci" 
    45local x = uci.cursor() 
    56 
    6 local update_url = "http://www.layereight.de/freifunkmap.php?update=%.15f,%.15f&olsrip=%s&note=%s&robot=%s" 
     7local update_url = "http://map.berlin.freifunk.net/freifunkmap.php?update=%.15f,%.15f&note=%s&olsrip=%s" 
    78local update_all = ( arg[1] and arg[1] == "all" ) and true or false 
    89 
     
    1011x:foreach("olsrd", "LoadPlugin", function(s) 
    1112    if s.library == "olsrd_nameservice.so.0.3" then 
    12         file = io.open(s.latlon_file) 
     13        luci.fs.copy (s.latlon_file, "/tmp/ff_mapupdate.latlon") 
     14        file = io.open("/tmp/ff_mapupdate.latlon") 
    1315    end 
    1416end) 
     
    2729            if ip and lat ~= 0.0 and lon ~= 0.0 and note then 
    2830                note = note:gsub("[^%w%-%.]+", "_") 
    29                 os.execute("wget -qO/dev/null %q" % string.format(update_url, lat, lon, ip, note, "luci-massupdate")) 
     31                os.execute("wget -qO/dev/null %q" % string.format(update_url, lat, lon, note, ip)) 
    3032                count = count + 1 
    3133            end 
     
    3840            if ip and lat ~= 0.0 and lon ~= 0.0 and note then 
    3941                note = note:gsub("[^%w%-%.]+", "_") 
    40                 os.execute("wget -qO/dev/null %q" % string.format(update_url, lat, lon, ip, note, "luci-selfupdate")) 
     42                os.execute("wget -qO/dev/null %q" % string.format(update_url, lat, lon, note, ip)) 
    4143                count = count + 1 
    4244            end