Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?python
- passwd_lines = metadata.Probes["passwd"].splitlines()
- current_users = [line.split(':')[0] for line in passwd_lines]
- ?>
- <Bundle name='localaccounts' xmlns:py="http://genshi.edgewall.org/">
- <py:for each="user in metadata.Properties['users.xml'].data.getchildren()">
- <py:if test="user.get('uid') not in current_users">
- <BoundAction name='addgroup'
- timing='pre'
- command='/usr/sbin/groupadd
- --non-unique
- --gid ${user.get("gidNumber")}
- ${user.get("uid")}'
- when='always'
- status='check'/>
- <BoundAction name='adduser'
- timing='pre'
- command='/usr/sbin/useradd
- --home ${user.get("homeDirectory")}
- --shell ${user.get("loginShell")}
- --uid ${user.get("uidNumber")}
- --gid ${user.get("gidNumber")}
- --comment "${user.get("gecos")}"
- --non-unique
- ${user.get("uid")}'
- when='always'
- status='check'/>
- </py:if>
- </py:for>
- </Bundle>
Add Comment
Please, Sign In to add comment