Ignore:
Timestamp:
08/22/06 20:03:34 (18 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/datacenter/scripts/sourcefile

    r7910 r7917  
    121121      continue
    122122   else
    123       exit
     123      finish
    124124   fi
    125125}
     
    199199}
    200200
    201 # function calling the macro to set the status, after a process has finished
    202 function setstatus()
    203 {
    204    # set status values
    205    resetstatusvalues
     201# function evaluating the statusvalues
     202function evalstatus()
     203{
    206204   case $@ in
    207205      start)   echo "setstatus start"
     
    233231               ;;
    234232   esac
     233}
     234
     235# function calling the macro to set the status, after a process has finished
     236function setstatusroot()
     237{
     238   # set status values
     239   resetstatusvalues
     240   evalstatus $@
    235241
    236242#   printstatusvalues
     
    260266function getstepinfo()
    261267{
    262    if [ "$singleprocess" = "yes" ]
    263    then
    264       column=${scriptscolname[$i]}
    265    fi
    266268   table=`grep "$column:" $steps | sed -e "s/[.]$column://" -e 's/#//' -e 's/ //g'`
    267269   coltab=`grep "$column:" $steps | sed -e 's/://' -e 's/#//' -e 's/ //g'`
     
    275277}
    276278
     279# function to get todolist
    277280function gettodo()
    278281{
    279282   echo "getting todo..."
    280283   getdbsetup
     284   if [ "$singleprocess" = "yes" ]
     285   then
     286      column=${scriptscolname[$i]}
     287   fi
    281288   getstepinfo
    282289   # get query
     
    304311   fi
    305312#   echo " QUERY: "$query
    306    process=`mysql -s -u $us --password=$pw --host=hercules $db -e " $query "`
     313   if ! process=`mysql -s -u $us --password=$pw --host=hercules $db -e " $query "`
     314   then
     315      echo "ERROR could not query process from db -> contex"
     316      contex
     317   fi
    307318
    308319   if [ "$process" = "" ]
     
    329340   fi
    330341}
     342
     343# function to set status of a process in the db
     344function setstatus()
     345{
     346   resetstatusvalues
     347   evalstatus $@
     348
     349   echo "setting todo..."
     350   getdbsetup
     351   getstepinfo
     352   # get query
     353   reset=`grep "$coltab[.]Reset:" $steps | sed -e "s/$coltab[.]Reset://" -e 's/ //g'`
     354   echo -$reset-
     355   if [ "$reset" = "no" ]
     356   then
     357      echo "YOU CAN'T RESET $column for $var2!!!"
     358      finish
     359   fi
     360   query=" update $table set $column=$statustime"
     361   if ! echo $influences | grep '#' > /dev/null
     362   then
     363      for influence in $influences
     364      do
     365         query=$query", $influence=NULL"
     366      done
     367   fi
     368   query=$query", fStartTime=$starttime, fFailedTime=$failedtime, fFailedCode=$failedcode, fFailedCodeAdd=$failedcodeadd, fReturnCode=$returncode "
     369   query=$query" where $primary=$var2"
     370   echo " QUERY: "$query
     371   if ! mysql -s -u $us --password=$pw --host=hercules $db -e " $query "
     372   then
     373      echo "ERROR could not insert status into db -> exit"
     374      finish
     375   fi
     376
     377}
Note: See TracChangeset for help on using the changeset viewer.