소스 검색

provision.pl - added user creation prompt because vultr

master
gashapwn 3 년 전
부모
커밋
8cfc3140cc
1개의 변경된 파일9개의 추가작업 그리고 1개의 파일을 삭제
  1. +9
    -1
      perl-script/provision.pl

+ 9
- 1
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(<STDIN> eq "Y\n"){
die "create a non-root user & set user passsword before running this script.";
}
printf("Username: ");
$admin_un = <STDIN>;
chomp $admin_un;
`useradd -m $admin_un`;
}

$admin_home_dir = "/home/$admin_un";


불러오는 중...
취소
저장