Forum: CFEngine Help
Subject: Re: read password hash from file
Author: phnakarin
Link to topic: https://cfengine.com/forum/read.php?3,22971,22979#msg-22979

Which version are you using? It seemed to work for me in 3.2.0b3.

body common control
{
 bundlesequence => {"test"};
 inputs => { "/var/cfengine/inputs/cfengine_stdlib.cf" };
}

bundle agent test
{
vars:
 "users" slist => {"user1","user2","user3","user4","user5"};
 "pwd_array" int => 
readstringarray("pwd","/tmp/shadow.txt","#[^\n]*",":","10","4000");

files:
 "/tmp/shadow"
    edit_line => set_shadow_values("$(pwd[$(users)][1])");
}

bundle edit_line set_shadow_values(user)
{
reports:
 linux::
  "$(user)";
}


Cheers,
--Nakarin

_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to