#
# Email: Wolfram Schneider <wosch@cs.tu-berlin.de>
#
-# $Id: adduser.perl,v 1.7 1995/05/20 13:05:22 jkh Exp $
+# $Id: adduser.perl,v 1.10 1996/02/10 17:15:47 wosch Exp $
#
# read variables
# List of directories where shells located
@path = ('/bin', '/usr/bin', '/usr/local/bin');
# common shells, first element has higher priority
- @shellpref = ('bash', 'tcsh', 'ksh', 'csh', 'sh');
+ @shellpref = ('csh', 'sh', 'bash', 'tcsh', 'ksh');
- $defaultshell = 'bash'; # defaultshell if not empty
+ $defaultshell = 'sh'; # defaultshell if not empty
$group_uniq = 'USER';
$defaultgroup = $group_uniq;# login groupname, $group_uniq means username
Shell: $sh
EOF
- return &confirm_yn("Ok?", "yes");
+ return &confirm_yn("OK?", "yes");
}
# make password database
print "\n";
local(@message_buffer_append) = ();
- if (!&confirm_yn("Add somethings to message", "no")) {
- print "Finish with beginning ``.'' or ^D\n";
+ if (!&confirm_yn("Add anything to default message", "no")) {
+ print "Use ``.'' or ^D alone on a line to finish your message.\n";
push(@message_buffer_append, "\n");
while($read = <STDIN>) {
last if $read eq "\.\n";
while(1) {
$password = &confirm_list("Enter password", 1, "", "");
last if $password ne "";
- last if &confirm_yn("Use empty password?", "yes");
+ last if &confirm_yn("Use an empty password?", "yes");
}
return $password;
print "\n" if $verbose;
print "Ok, let's go.\n" .
- "Don't worry about mistakes. I ask you later for " .
- "correct input.\n" if $verbose;
+ "Don't worry about mistakes. I will give you the chance later to " .
+ "correct any input.\n" if $verbose;
# name: Username
# fullname: Full name
} else {
$new_users_ok = 0;
}
- if (!&confirm_yn("Continue with next user?", "yes")) {
- print "Good bye.\n" if $verbose;
+ if (!&confirm_yn("Add another user?", "yes")) {
+ print "Goodbye!\n" if $verbose;
last;
}
print "\n" if !$verbose;
sub hints {
if ($verbose) {
print "Use option ``-silent'' if you don't want see " .
- "some warnings & questions.\n\n";
+ "all warnings & questions.\n\n";
} else {
print "Use option ``-verbose'' if you want see more warnings & " .
"questions \nor try to repair bugs.\n\n";
return 0;
}
- return mkdir("$homedir",0755) if $dotdir eq "no";
+ if ($dotdir eq 'no') {
+ if (!mkdir("$homedir",0755)) {
+ warn "mkdir $homedir: $!\n"; return 0;
+ }
+ system 'chown', "$name:$group", $homedir;
+ return !$?;
+ }
# copy files from $dotdir to $homedir
# rename 'dot.foo' files to '.foo'