-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGenerateWeatherData.sh
More file actions
executable file
·65 lines (55 loc) · 2.05 KB
/
GenerateWeatherData.sh
File metadata and controls
executable file
·65 lines (55 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/ksh
#######################################################
#Author: Wang Cheng
#Date: 19 June 2016
#Des: Using WeatherGenerator.py python program generates
#all cities weather information.
#######################################################
##################################################################################
#Title :GenerateWeatherData.sh
#Description :
#
# : This is to generate weather data
#Author :Mohamed Asimulla S
#Date :22/04/2017
#Version :1.0
#Usage :GenerateWeatherData.sh
#Notes :
#Limitation: :Desgined to work without any parameter
# :
##################################################################################
#Variable Initialization
ENV=""
HOSTNAME=`hostname`
IPADRESS=`grep $HOSTNAME /etc/hosts |grep "^[^#;]" |awk '{print $1}'`
USERID=`whoami`
LOGNAME=$HOSTNAME
LOGDIR=~/
TMP=${LOGDIR}/${LOGNAME}.${pid}
TMP2=${LOGDIR}/${LOGNAME}.${pid}.$$
LOCATIONS_LIST="`./readTagValue.sh Location.xml Weather_location`"
#Overtite XML value for testing it might be shell depend
#LOCATIONS_LIST=" Adelaide Perth London Melbourne Moscow Ottawa Paris Seoul Shanghai Singapore Sydney Tokyo Toronto"
set -A LOCATIONS_LIST Adelaide Perth London Melbourne Moscow Ottawa Paris Seoul Shanghai Singapore Sydney Tokyo Toronto
##################################################################################
#Error Handling
##################################################################################
Clean_Up()
{
# Perform program exit housekeeping
# Optionally accepts an exit status
exit 1
}
trap Clean_Up SIGHUP SIGINT SIGTERM
##################################################################################
#Main Function Call
##################################################################################
i=0
while [ $i -lt ${#LOCATIONS_LIST[*]} ]
do
echo ${LOCATIONS_LIST[$i]}
python GenerateWeather.py ${LOCATIONS_LIST[$i]}
(( i=i+1 ))
done
#this required to ensure the process has terminated the program normally
exit 0