#! /bin/bash
#
# The System Manager
# An Administration Tool For UNIX
#
# Copyright (c) 1994 Stuart Herbert
# Released under the GNU GPL v2
#
# Bugs/comments/contributions to S.Herbert@Sheffield.ac.uk

function main()
{
  local AuthorInfo
  local x
  
  InfoBox "Getting AUTHOR information ... please wait"
  
  if [ -f $SysmanFile1 ]; then
    rm -f $SysmanFile1
  fi
  
  if [ -f README.module ]; then
    README.module --SysmanAuthor > $SysmanFile1
  fi
  
  for x in * ; do
    AuthorInfo=""
    if [ -d $x ]; then
      AuthorInfo="`$x/README.module --SysmanAuthor`"
    elif [ -x $x -a "$x" != "README.module" ]; then
      AuthorInfo="`./$x --SysmanAuthor`"
    fi
    if [ -n "$AuthorInfo" ]; then
      if [ -s $SysmanFile1 ]; then
        echo "--*- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*-- --*--" >> $SysmanFile1
      fi
      echo "$AuthorInfo" >> $SysmanFile1
    fi
  done
  
  if [ -s $SysmanFile1 ]; then
    TextBox $SysmanFile1
  fi
}

# main code
if [ -n "$1" ]; then
  case "$1" in
    --SysmanInstall)
      echo "Y : Y : INFO : Show Author Information :$0"
      exit
      ;;
    --SysmanAuthor)
      echo "INFO : Show Author Information"
      echo "Copyright (c) Stuart Herbert"
      exit
      ;;
  esac
else
  main
fi

# clean up here
for x in $SysmanFile1 $SysmanFile2 $SysmanFile3 ; do
  if [ -f $x ]; then rm -f $x ; fi
done

# that's it, folks
