diff --git a/perl-script/provision.pl b/perl-script/provision.pl index 00a2e2b..97882d7 100644 --- a/perl-script/provision.pl +++ b/perl-script/provision.pl @@ -35,7 +35,15 @@ if($pwuid ne "root"){ if( ($admin_un) = `tail /etc/passwd | grep -v "nobody:"` =~ /([^:\n]+):[^:]+:[0-9]{4,}/){ printf("admin user will be set to %s\n", $admin_un); }else{ - die "create a non-root user & set user passsword before running this script." + printf("need a non-root user...\n"); + printf("want to create a user? Y/N\n"); + unless( eq "Y\n"){ + die "create a non-root user & set user passsword before running this script."; + } + printf("Username: "); + $admin_un = ; + chomp $admin_un; + `useradd -m $admin_un`; } $admin_home_dir = "/home/$admin_un";