Changeset 1597


Ignore:
Timestamp:
08/06/09 07:45:12 (16 years ago)
Author:
Mathieu Morlighem
Message:

Added function to get host name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/cron/nightlyrun.sh

    r1595 r1597  
    66function timer()
    77{
     8        #if no input: return time, else return elapsed time
    89        if [[ $# -eq 0 ]]; then
    910                echo $(date '+%s')
     
    2122        fi
    2223}
    23 function todaydate()
     24function today_date()
    2425{
    25         export today=`date | awk '{printf("%s-%s-%s",$2,$3,$6);}'`;
     26        #return today date
    2627        suffix=`date | awk '{printf("%s-%s-%s",$2,$3,$6);}'`                     
    27         echo $suffix;                   
     28        echo $suffix;
     29}
     30function host_name()
     31{
     32        #return host name depending on the OS
     33        if [[ "$1" == "winxp32" ]]
     34        then
     35                HOST_NAME=`hostname`;
     36        else
     37                HOST_NAME=`hostname -s`;
     38        fi
     39        echo $HOST_NAME;
    2840}
    2941
     
    4153
    4254#create nightly run variables
    43 export TODAY=$(todaydate);
    44 export HOST_NAME=`hostname`;
     55export TODAY=$(today_date);
     56export HOST_NAME=$(host_name $OS);
    4557export ISSM_RELEASE="issm"
    4658export OS
     59echo $HOST_NAME
     60exit
    4761
    4862#create ISSM variables
     
    149163From: "ISSM Nightly run" <$EMAIL_ADRESS>
    150164To: $i
    151 Subject: Nightly runs of $ISSM_RELEASE , operating system: $OS.
     165Subject: Nightly runs of $ISSM_RELEASE, operating system: $OS.
    152166Mime-Version: 1.0
    153167Content-Type: text/html
     
    157171From: "ISSM Nightly run" <$EMAIL_ADRESS>
    158172To: $i
    159 Subject: Nightly runs of $ISSM_RELEASE , operating system: $OS.
     173Subject: Nightly runs of $ISSM_RELEASE, operating system: $OS.
    160174Mime-Version: 1.0
    161175Content-Type: text/html
Note: See TracChangeset for help on using the changeset viewer.