forked from zentralwerk/network
pkgs/starlink: fix convert.rb
This commit is contained in:
parent
ef371b32c4
commit
14f377248b
|
@ -7,7 +7,7 @@ require 'json'
|
||||||
HOSTNAME = IO::readlines("/proc/sys/kernel/hostname").join.strip
|
HOSTNAME = IO::readlines("/proc/sys/kernel/hostname").join.strip
|
||||||
|
|
||||||
def out path, x
|
def out path, x
|
||||||
puts "PUTVAL \"#{HOSTNAME}/exec-starlink/current-#{path.join '.'}\" #{x}"
|
puts "PUTVAL \"#{HOSTNAME}/exec-starlink/current-#{path.join '.'}\" N:#{x}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def recurse path, x
|
def recurse path, x
|
||||||
|
@ -22,7 +22,7 @@ def recurse path, x
|
||||||
|
|
||||||
elsif x.kind_of? Float
|
elsif x.kind_of? Float
|
||||||
out path, x
|
out path, x
|
||||||
elsif x.kind_of? Fixnum
|
elsif x.kind_of? Integer
|
||||||
out path, x.to_f
|
out path, x.to_f
|
||||||
elsif x.kind_of? String and x =~ /^\-?\d*\.?\d+$/
|
elsif x.kind_of? String and x =~ /^\-?\d*\.?\d+$/
|
||||||
out path, x.to_f
|
out path, x.to_f
|
||||||
|
|
Loading…
Reference in New Issue