- #!/bin/bash
- #create users and quota for /home patition
- #批量创建用户并分配磁盘配额
- #2012-10-15 v1
- if [ ! $(grep quotagrp /etc/group) ];then
- groupadd quotagrp
- echo "quotagrp created."
- else
- echo "quotagrp exist."
- fi
- declare -i n;
- for((n=6;n<=10;n=$n+1))
- do
- useradd -g quotagrp user$n
- echo "user$n" | passwd --stdin user$n
- setquota -u user$n 50000 60000 0 0 /home
- done
转载于:https://blog.51cto.com/carllai/1026827