From 05e763eb61b5e037ec65ec752f3b322de1ea7d57 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Tue, 7 Feb 2006 14:41:10 +0000 Subject: Cosmetics. --- ezjail-config.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'ezjail-config.sh') diff --git a/ezjail-config.sh b/ezjail-config.sh index 927ab23..3a1d8ea 100644 --- a/ezjail-config.sh +++ b/ezjail-config.sh @@ -14,8 +14,8 @@ ezjail_flavour_users=${ezjail_flavour_users:-""} ezjail_flavour_files=${ezjail_flavour_files:-""} # try to create users -for user in $ezjail_flavour_users; do - TIFS=$IFS; IFS=:; set -- $user; IFS=$TIFS +for user in ${ezjail_flavour_users}; do + TIFS=${IFS}; IFS=:; set -- ${user}; IFS=${TIFS} if [ $# -eq 8 ]; then gc=1; name=$1; grouplist=$3; gidlist=$4; home=$7 @@ -24,31 +24,31 @@ for user in $ezjail_flavour_users; do [ $6 ] && pass="$6" || pass="*" [ $8 ] && shell="-s $8" || shell="" - [ "$home" = "${home#-}" ] && mkhome="-m" || mkhome="" + [ "${home}" = "${home#-}" ] && mkhome="-m" || mkhome="" [ ${home#-} ] && home="-d ${home#-}" || home="" # ensure all groups - if [ $grouplist ]; then - for group in `echo $grouplist | tr "," " "`; do - gid=`echo $gidlist | cut -d , -f $gc`; [ $gid ] && gid="-g $gid" - pw groupadd -n $group $gid - gc=$((1+$gc)) + if [ ${grouplist} ]; then + for group in `echo -n ${grouplist} | tr "," " "`; do + gid=`echo ${gidlist} | cut -d , -f ${gc}`; [ "${gid}" ] && gid="-g ${gid}" + pw groupadd -n ${group} ${gid} + gc=$((1+${gc})) done fi # create user - [ $grouplist ] && grouplist="-G $grouplist" - [ $name ] && echo "$pass" | pw useradd -n $name $uid $shell $mkhome $home $grouplist "`echo $comment | tr = ' '`" -H 0 + [ "${grouplist}" ] && grouplist="-G ${grouplist}" + [ "${name}" ] && echo "${pass}" | pw useradd -n ${name} ${uid} ${shell} ${mkhome} ${home} ${grouplist} "`echo -n${comment} | tr = ' '`" -H 0 fi done # chmod all files not belonging to root -for file in $ezjail_flavour_files; do - TIFS=$IFS; IFS=:; set -- $file; IFS=$TIFS +for file in ${ezjail_flavour_files}; do + TIFS=${IFS}; IFS=:; set -- ${file}; IFS=${TIFS} set +o noglob if [ $# -eq 3 -a "$3" ]; then owner=$1; [ $2 ] && owner="$1:$2" for file in ./$3; do - chown -R $owner /$file + chown -R ${owner} /${file} done fi set -o noglob -- cgit v1.2.3