Fold in latest changes from ticket 1590

This commit is contained in:
Kevin Fenzi 2015-08-28 23:57:10 +00:00
parent 8a55e81b74
commit bedc824e17

View file

@ -1,9 +1,9 @@
#!/bin/bash #!/bin/bash
tmpdir=`mktemp -d` tmpdir=`mktemp -d`
outfile=$tmpdir/index.html outfile=${tmpdir}/index.html
finalfile=/srv/people/site/index.html finalfile=/srv/people/site/index.html
cat <<EOM>>$outfile cat << EOM>> ${outfile}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
@ -70,38 +70,36 @@ cat <<EOM>>$outfile
EOM EOM
users=`getent passwd | sort| cut -d: -f1,6 | grep '/home/fedora/'` users=`getent passwd | sort| cut -d: -f1,6 | grep '/home/fedora/'`
for useranddir in $users for useranddir in ${users}
do do
user=`echo $useranddir| cut -d: -f1` user=`echo ${useranddir}| cut -d: -f1`
homedir=`echo $useranddir| cut -d: -f2` homedir=`echo ${useranddir}| cut -d: -f2`
name="`getent passwd $user | cut -d: -f5`" name="`getent passwd ${user} | cut -d: -f5`"
homepage="" homepage=""
cgit="" cgit=""
[ -d $homedir/public_html/ ] && homepage="<a href=\"https://${user}.fedorapeople.org\">$user's homepage</a>" [ -d ${homedir}/public_html/ ] && homepage="<a href=\"https://${user}.fedorapeople.org\">${user}'s homepage</a>"
[ -d $homedir/public_git/ ] && cgit="<a href=\"https://fedorapeople.org/cgit/$user/\">Git repositories</a>" [ -d ${homedir}/public_git/ ] && cgit="<a href=\"https://fedorapeople.org/cgit/${user}/\">Git repositories</a>"
[ -z ${homepage} -a -z ${cgit} ] && continue [ -z "${homepage}" -a -z "${cgit}" ] && continue
cat <<EOM>> $outfile cat << EOM>> ${outfile}
<tr class="userinfo"> <tr class="userinfo">
<td>$name</td> <td>${name}</td>
<td> <td>
EOM EOM
[ ! -z ${homepage} ] && echo " ${homepage}" >> $outfile [ ! -z "${homepage}" ] && echo " ${homepage}" >> ${outfile}
[ ! -z ${homepage} -a ! -z ${cgit} ] && echo " <br />" >> $outfile [ ! -z "${homepage}" -a ! -z "${cgit}" ] && echo " <br />" >> ${outfile}
[ ! -z ${cgit} ] && echo " ${cgit}" >> $outfile [ ! -z "${cgit}" ] && echo " ${cgit}" >> ${outfile}
cat <<EOM>> $outfile cat << EOM>> ${outfile}
</td> </td>
</tr> </tr>
EOM EOM
fi
done done
cat << EOM>> $outfile cat << EOM>> ${outfile}
</table> </table>
<div id="admincontact"> <div id="admincontact">
Contact: <a href="mailto:admin at fedoraproject.org">admin at fedoraproject.org</a><br /> Contact: <a href="mailto:admin at fedoraproject.org">admin at fedoraproject.org</a><br />
<ul id="sponsors"> <ul id="sponsors">
<li><a href="http://linux.dell.com"><img src="http://torrent.fedoraproject.org/images/poweredby_horizontal_lr.gif" alt="Powered by Dell" width="106" height="35"/></a></li> <li style="width: 150px;"><a href="http://ibiblio.org/"><img src="https://fedoraproject.org/static/images/sponsors/ibiblio.png" alt="ibiblio" /></a></li>
<li><a href="http://www.internetx.com/"><img src="http://fedoraproject.org/static/images/sponsors/internetx.png" width="122" height="47" alt="InterNet X" /></a></li>
</ul> </ul>
</div> </div>
</div> </div>
@ -125,7 +123,7 @@ cat << EOM>> $outfile
</html> </html>
EOM EOM
cp -f $outfile $finalfile cp -f ${outfile} ${finalfile}
chgrp web $finalfile chgrp web ${finalfile}
chmod g+w $finalfile chmod g+w ${finalfile}