1 Star 0 Fork 20

dam/vos3000-2.1.7.03

forked from Vos3000/vos3000-2.1.7.03 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
create_user_kunshi.sh 1.37 KB
一键复制 编辑 原始数据 按行查看 历史
gooelg 提交于 2020-12-08 15:18 . 2.1.7.03
#!/bin/sh
check_user_env()
{
grep "kunshi " /etc/security/limits.conf > /dev/null 2>&1
if [ "$?" != "0" ];then
echo "kunshi soft nofile 65535" >> /etc/security/limits.conf
echo "kunshi hard nofile 65535" >> /etc/security/limits.conf
echo "kunshi - core unlimited " >> /etc/security/limits.conf
fi
if [ -f /home/kunshi/.bashrc ];then
grep 'ulimit -n 65535' /home/kunshi/.bashrc > /dev/null 2>&1
[ "$?" != 0 ] && { echo 'ulimit -n 65535' >> /home/kunshi/.bashrc;}
grep 'ulimit -c unlimited' /home/kunshi/.bashrc > /dev/null 2>&1
[ "$?" != 0 ] && { echo 'ulimit -c unlimited' >> /home/kunshi/.bashrc;}
grep 'umask 0007' /home/kunshi/.bashrc > /dev/null 2>&1
[ "$?" != 0 ] && { echo 'umask 0007' >> /home/kunshi/.bashrc;}
grep 'PATH=' /home/kunshi/.bashrc > /dev/null 2>&1
[ "$?" != 0 ] && { echo 'PATH=/sbin:/bin:/usr/sbin:/usr/bin; export PATH' >> /home/kunshi/.bashrc;}
fi
}
check_user()
{
chage -l kunshi > /dev/null 2>&1
if [ "$?" = "0" ];then
check_user_env
return;
fi
groupadd -r kunshi > /dev/null 2>&1
useradd -g kunshi -m -d /home/kunshi -s /bin/bash -r -c 'Kunshi voip' kunshi
chage -m -1 -M -1 kunshi > /dev/null 2>&1
chage -l kunshi > /dev/null 2>&1
if [ "$?" != "0" ];then
echo -e "\tCreate linux user failed"
exit 1
fi
mkdir -p /home/kunshi/base
check_user_env
}
check_user
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/damd/vos3000-2.1.7.03.git
[email protected]:damd/vos3000-2.1.7.03.git
damd
vos3000-2.1.7.03
vos3000-2.1.7.03
main

搜索帮助