"Fossies" - the Fresh Open Source Software Archive

Member "systeminfo/report/automate.sh" (4 Feb 2005, 1566 Bytes) of package /linux/privat/old/systeminfov12.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/bash
    2 # Systeminfo Report Generation Automator
    3 
    4 # Input from customer
    5 echo
    6 echo "Systeminfo Report Generation Automator - Muthukumar Kandasamy"
    7 echo
    8 echo "Note : Any of the web-server has to run to view Systeminfo Reports"
    9 echo
   10 echo "Enter your web-server Location to generate systeminfo reports"
   11 echo "Default Location: [/var/www/html/systeminfo]"
   12 echo
   13 echo "Do you want to changes the location (yes/no)"
   14 read ans
   15 echo
   16 echo $ans | grep -iq 'yes'
   17 if [[ $? -eq 0 ]]
   18 then
   19 echo "Enter new location to put systeminfo web-pages"
   20 read location
   21 else
   22 location="/var/www/html/systeminfo"
   23 fi
   24 location=`echo $location | sed 's%/$%%g'`
   25 
   26 if [[ ! -d $location ]]
   27 then
   28     echo "$location does not exist!"
   29     echo "Do you want to create (yes/no)"
   30     read ans
   31     echo
   32     echo $ans | grep -iq 'yes'
   33     if [[ $? -eq 0 ]]
   34     then
   35         mkdir $location
   36     if [[ $? -ne 0 ]]
   37         then
   38             echo "Error! Could not create $location directory"
   39             exit -1
   40         fi
   41     else
   42     exit -1
   43     fi
   44 fi
   45 
   46 cp index.html $location/index.html
   47 cp sysinfo_image.JPG $location/sysinfo_image.JPG
   48 
   49 # Automation
   50 echo "Report Generation Result"
   51 echo "------------------------"
   52 echo
   53 for file in `ls *.sh | grep -v 'automate.sh'`; do
   54 echo "$PWD/$file $location" | sh
   55 if [[ $? -eq 0 ]]
   56 then
   57 echo "System `echo $file | cut -d "." -f1` Information generation  ---  SUCCESS"
   58 else
   59 echo "System `echo $file | cut -d "." -f1` Information generation  ---  FAILED"
   60 fi
   61 done
   62 
   63 # Updation Details
   64 perl -pi -e '
   65 $var=`date`;
   66 chop($var);
   67 s%arial;"></span>%arial;">$var</span>%g' $location/*.html