#!/bin/bash #create users and quota for /home patition #批量創建用戶並分配磁盤配額 #2012-10-15 v1 #http://www.bianceng.cn 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