lang: core: sys, engine: resource: Update hostname functionality
We didn't have a solid resource and sys.hostname() didn't have events!
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import "sys"
|
||||
import "util"
|
||||
|
||||
$m = {
|
||||
@@ -7,6 +8,12 @@ $m = {
|
||||
"aa:bb:cc:dd:ee:ff" => "hostname2",
|
||||
}
|
||||
|
||||
print "mapper" {
|
||||
msg => util.hostname_mapper($m),
|
||||
$h = util.hostname_mapper($m)
|
||||
|
||||
print "hostname_mapper" {
|
||||
msg => $h,
|
||||
}
|
||||
|
||||
if $h != "" and sys.hostname() != $h {
|
||||
hostname "${h}" {} # set it correctly!
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user