Created
October 9, 2015 19:19
-
-
Save sv99/81983e6da8c4067f9c3b to your computer and use it in GitHub Desktop.
создание домашнего каталога пользователя для работы с почтой
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# make home dir for user | |
# используется для создания домашнего каталога пользователя для работы с почтой | |
# устанавливает правильные разрешения на домашний каталог | |
# | |
# Изменен: 18.07.2008 | |
if [ -z "$1" ] ; then | |
echo "Usage: $0 user_name" | |
exit 1 | |
fi | |
if ( ! id $1 > /dev/null 2>&1 ) ; then | |
echo "user not exists" | |
exit 1 | |
fi | |
if [ -d /home/$1 ] ; then | |
echo "/home/$1 exists" | |
exit 1 | |
fi | |
mkdir /home/$1 | |
chown $1:"Domain Users" /home/$1 | |
echo "/home/$1 created" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment