#!/bin/awk -f
#script to feedback the node provision status to xcatd
BEGIN {

        xcatdhost = ARGV[1]
        xcatiport = ARGV[2]


        ns = "/inet/tcp/0/" xcatdhost "/" xcatiport
        print "xCAT_xcatd" |& ns

        while(1) {
                ns |& getline

                if($0 == "ready")
                        print ARGV[3] |& ns
                if($0 == "done")
                        break
        }

        close(ns)

        exit 0
}
