1 Star 0 Fork 20

klxs/vos3000-2.1.7.03

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

搜索帮助