25 |
- "-s", "/bin/false", |
- "-s", "/bin/false", |
26 |
- "$machineName" |
- "$machineName" |
27 |
- ) == 0 or die "Failed to create account $machineName.\n"; |
- ) == 0 or die "Failed to create account $machineName.\n"; |
28 |
+if ($domainauth eq 'enabled') |
+if ($ldapauth eq 'enabled') |
29 |
+{ |
+{ |
30 |
+ system( |
+ system( |
31 |
+ "/usr/sbin/cpu", "-C/etc/cpu-system.conf", "useradd", |
+ "/usr/sbin/cpu", "-C/etc/cpu-system.conf", "useradd", |
32 |
+ "--usebase=ou=Computers,$base", |
+ "--userbase=ou=Computers,$base", |
33 |
+ "-c", "Hostname account for $machineName", |
+ "-c", "Hostname account for $machineName", |
34 |
+ "-o", |
+ "-o", |
35 |
+ "-d", "/noexistingpath", |
+ "-d", "/noexistingpath", |
40 |
+ warn "create-machine-account $machineName: Locking account\n"; |
+ warn "create-machine-account $machineName: Locking account\n"; |
41 |
+ |
+ |
42 |
+ system("/usr/sbin/cpu", "-C/etc/cpu-system.conf", "usermod", |
+ system("/usr/sbin/cpu", "-C/etc/cpu-system.conf", "usermod", |
43 |
+ "--usebase=ou=Computers,$base", |
+ "--userbase=ou=Computers,$base", |
44 |
+ "-o", |
+ "-o", |
45 |
+ "-L", |
+ "-L", |
46 |
+ "$machineName" |
+ "$machineName" |