From bedc824e177ab5c0d27bd161fe47cc2134d73cc8 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Fri, 28 Aug 2015 23:57:10 +0000 Subject: [PATCH] Fold in latest changes from ticket 1590 --- roles/people/files/make-people-page.sh | 44 ++++++++++++-------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/roles/people/files/make-people-page.sh b/roles/people/files/make-people-page.sh index 501386a2b6..e03272a968 100755 --- a/roles/people/files/make-people-page.sh +++ b/roles/people/files/make-people-page.sh @@ -1,9 +1,9 @@ #!/bin/bash tmpdir=`mktemp -d` -outfile=$tmpdir/index.html +outfile=${tmpdir}/index.html finalfile=/srv/people/site/index.html -cat <>$outfile +cat << EOM>> ${outfile} @@ -70,38 +70,36 @@ cat <>$outfile EOM users=`getent passwd | sort| cut -d: -f1,6 | grep '/home/fedora/'` -for useranddir in $users +for useranddir in ${users} do - user=`echo $useranddir| cut -d: -f1` - homedir=`echo $useranddir| cut -d: -f2` - name="`getent passwd $user | cut -d: -f5`" + user=`echo ${useranddir}| cut -d: -f1` + homedir=`echo ${useranddir}| cut -d: -f2` + name="`getent passwd ${user} | cut -d: -f5`" homepage="" cgit="" - [ -d $homedir/public_html/ ] && homepage="$user's homepage" - [ -d $homedir/public_git/ ] && cgit="Git repositories" - [ -z ${homepage} -a -z ${cgit} ] && continue - cat <> $outfile + [ -d ${homedir}/public_html/ ] && homepage="${user}'s homepage" + [ -d ${homedir}/public_git/ ] && cgit="Git repositories" + [ -z "${homepage}" -a -z "${cgit}" ] && continue + cat << EOM>> ${outfile} - $name + ${name} EOM - [ ! -z ${homepage} ] && echo " ${homepage}" >> $outfile - [ ! -z ${homepage} -a ! -z ${cgit} ] && echo "
" >> $outfile - [ ! -z ${cgit} ] && echo " ${cgit}" >> $outfile - cat <> $outfile + [ ! -z "${homepage}" ] && echo " ${homepage}" >> ${outfile} + [ ! -z "${homepage}" -a ! -z "${cgit}" ] && echo "
" >> ${outfile} + [ ! -z "${cgit}" ] && echo " ${cgit}" >> ${outfile} + cat << EOM>> ${outfile} EOM - fi done - -cat << EOM>> $outfile + +cat << EOM>> ${outfile} @@ -125,7 +123,7 @@ cat << EOM>> $outfile EOM -cp -f $outfile $finalfile -chgrp web $finalfile -chmod g+w $finalfile +cp -f ${outfile} ${finalfile} +chgrp web ${finalfile} +chmod g+w ${finalfile}