Files
StateGrid/install_shell/create_users.sh
Peng Zhihui 391c6cccaf rm set_fcitx and continue to use scim defaultly
modified:   install_shell/create_users.sh
	deleted:    install_shell/set_fcitx.sh
	new file:   install_shell/set_tcsh_encode.sh
	modified:   setup.sh
2014-03-18 15:43:55 +08:00

46 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
. ./check_function.sh
#$1:user name,$2:home directory,$3:shell type
#examples :
#d5000 /home/d5000/guodiao tcsh
#kingsoft /home/kingsoft/guodiao bash
#ems /users/ems tcsh
USER_SHELL=$3
USER_HOME=$2
USER_NAME=$1
# check $USER_NAME group
GRP_CONFIG=/etc/group
check_config $GRP_CONFIG ^${USER_NAME}
if [ $rtn -eq 2 ]; then
groupadd ${USER_NAME}
elif [ $rtn -eq 0 ]; then
echo "${USER_NAME} group exist..."
fi
# check ${USER_NAME}
USER_CONFIG=/etc/passwd
check_config $USER_CONFIG ${USER_NAME}
if [ $rtn -eq 2 ]; then
mkdir -p ${USER_HOME}
useradd -m -d ${USER_HOME} -s /bin/${USER_SHELL} ${USER_NAME}
usermod -p `openssl passwd ${USER_NAME}` -g ${USER_NAME} -G audio,tty ${USER_NAME}
elif [ $rtn -eq 0 ]; then
usermod -g ${USER_NAME} -G audio,tty ${USER_NAME}
echo "${USER_NAME} user exist..."
fi
# check ${USER_NAME} home
check_konsole $USER_HOME
check_konsole $HOME
cp -r root-kde/.kde $HOME/
cp -r d5000-kde/.kde $USER_HOME/
#cp -r /etc/skel/.kde $USER_HOME/
chown -R ${USER_NAME}:${USER_NAME} ${USER_HOME}
usermod -p `openssl passwd root` root