#!/bin/bash
function MKAccount {
Account=$1
useradd $Account
}
function MKDirectory {
Account=$1
Dirctory=$2
mkdir -p ~$Account/$Directory
if [ $(whoami) == "root" ]; then
chown -R $Account.$Account ~$Account/$Directory
fi
}
printf "%s" "사용자의 게정은? ___"
read USER
printf "%s" "생성하고자하는 디렉토리는? ____"
read DIRECTORY
printf "%s" "사용자 $USER 를 생성합니다. "
MKAccount $USER
printf "%s" "사용자 $USER에 디렉토리 $DIRECTORY 를 생성합니다."
MKDirectory $USER $DIRECTORY
-----------------------------------------
급조한거라 될지 안될지 모르겠군요..
:)
: 사용자 계정을 새로 만들고 개인 홈디렉토리 밑에
: 또 다른 디렉토리를 만드는 스크립트가 필요합니다..
:
: 혹시...아시는분...답글..달아주세요...급해요..--금연합시다.. =_=;;;