#!/bin/sh # This script creates the html document that displays your current # users on the mars/samba server in a nice html format base="/hamster/home/" # Base dir of home dirs echo "" echo "Mars Server - Current users" echo "" echo "

MarsServer User List and Email addresses

" echo 'Nice graphic that you cannot see' echo "" echo "

(See how much diskspace is in use by the users)

" touch /tmp/ulist.tmp rm /tmp/ulist.tmp mv /etc/ohulist /etc/ohulist- touch /tmp/ulist.tmp for l in `ls $base/httpd/html`; do LNAME=`grep "^$l:" /etc/passwd | cut -f 5 -d : - | cut -f 1 -d , -` if [ $l = "ftp" ]; then LNAME=""; fi if [ $l = "gopher" ]; then LNAME=""; fia ### NNNB Please add simular lines not to display other kinds of autousers. if [ "$LNAME" != "" ]; then echo "$LNAME : $l" >> /tmp/ulist.tmp fi done cat /tmp/ulist.tmp | sort > /tmp/ulist2.tmp rm /tmp/ulist.tmp cat /tmp/ulist2.tmp | cut -f 2 -d : - > /tmp/ulist3.tmp rm /tmp/ulist2.tmp echo "

" for l in `cat /tmp/ulist3.tmp`; do LNAME=`grep "^$l:" /etc/passwd | cut -f 5 -d : - | cut -f 1 -d , -` # OFONE=`grep $l /etc/passwd | cut -f 5 -d : - # echo "$LNAME with $l" echo -n '" echo -e "$LNAME \t\t\t email: $l@email.domain.name" >> /etc/ohulist done echo "
' echo -n "$LNAME' echo "$l@eng.rau.ac.za
" echo "This service brought to you by Marsmail scripting." echo "
" echo "(Use your browsers BACK button to go back to the main page.)" echo -n "" echo -n "" rm /tmp/ulist3.tmp