-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdoweather.cmd.bak
135 lines (116 loc) · 4.43 KB
/
doweather.cmd.bak
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
@echo off
:: /--------------------------------------------------------------------------/
:: QUESTOR - Questor Systems GmbH, http://www.questor.ch ([email protected])
:: /--------------------------------------------------------------------------/
::
:: doweather.cmd: Call weather.pl script, redirect output to file and then email it to recipient
::
:: Project:
:: Author: Farley Balasuriya, ([email protected])
::
:: Created: Tue Jun 7 23:50:58 2005
:: History:
:: v0.2 -
:: v0.1 - 07/06/05 - initial version created
::
:: /--------------------------------------------------------------------------/
:: /--------------------------------------------------------------------------/
:: ___ _ ____ _
:: / _ \ _ _ ___ ___| |_ ___ _ __ / ___| _ _ ___| |_ ___ _ __ ___ ___
::| | | | | | |/ _ \/ __| __/ _ \| '__| \___ \| | | / __| __/ _ \ '_ ` _ \/ __|
::| |_| | |_| | __/\__ \ || (_) | | ___) | |_| \__ \ || __/ | | | | \__ \
:: \__\_\\__,_|\___||___/\__\___/|_| |____/ \__, |___/\__\___|_| |_| |_|___/
:: |___/
::
:: Questor Sytesms GmbH, Basel, CH-4053, Schweiz
:: http://www.questor.ch, mailto:[email protected]
:: /--------------------------------------------------------------------------/
@if not "%ECHO%"=="" echo %ECHO%
@if not "%OS%"=="Windows_NT" goto DOSEXIT
:: Set local scope and call MAIN procedure
setlocal & pushd & set RET=
:: /--------------------------------------------------------------------------/
set svn_rev=$Rev: 114 $
set svn_id=$Id: tq.cmd 114 2005-04-25 13:59:09Z farley $
set svn_LastChangedDate=$LastChangedDate: 2005-04-25 15:59:09 +0200 (Mon, 25 Apr 2005) $
set SCRIPTNAME=%~n0
set SCRIPTPATH=%~f0
:: /--------------------------------------------------------------------------/
if "%QS_Debug%"=="1" (set TRACE=echo) else (set TRACE=rem)
call _CMDLib :INIT %SCRIPTPATH%
:QSCDEInit
if not %QS_Init%.==1. call QSCDE
:ARGS
if /i {%1}=={/help} (call :HELP %2) & (goto :HELPEXIT)
if /i {%1}=={/h} (call :HELP %2) & (goto :HELPEXIT)
if /i {%1}=={/HELP} (call :HELP %2) & (goto :HELPEXIT)
if /i {%1}=={/H} (call :HELP %2) & (goto :HELPEXIT)
if /i {%1}=={/?} (call :HELP %2) & (goto :HELPEXIT)
if /i {%1}=={--help} (call :HELP %2) & (goto :HELPEXIT)
if /i {%1}=={-h} (call :HELP %2) & (goto :HELPEXIT)
if /i {%1}=={--HELP} (call :HELP %2) & (goto :HELPEXIT)
if /i {%1}=={-h} (call :HELP %2) & (goto :HELPEXIT)
if /i {%1}=={-?} (call :HELP %2) & (goto :HELPEXIT)
:VERSION
if /i {%1}=={/v} (call :VERSION %2) & (goto :HELPEXIT)
if /i {%1}=={/version} (call :VERSION %2) & (goto :HELPEXIT)
if /i {%1}=={/V} (call :VERSION %2) & (goto :HELPEXIT)
if /i {%1}=={/VERSION} (call :VERSION %2) & (goto :HELPEXIT)
if /i {%1}=={-v} (call :VERSION %2) & (goto :HELPEXIT)
if /i {%1}=={--version} (call :VERSION %2) & (goto :HELPEXIT)
if /i {%1}=={-V} (call :VERSION %2) & (goto :HELPEXIT)
if /i {%1}=={--VERSION} (call :VERSION %2) & (goto :HELPEXIT)
call :MAIN %*
:HELPEXIT
popd & endlocal & set RET=%RET%
goto :EOF
:: /--------------------------------------------------------------------------/
:: MAIN procedure
:: /--------------------------------------------------------------------------/
:MAIN
if defined TRACE %TRACE% [proc %0 %*]
:: Do we require arguments for this script?
:: if %1.==. goto USAGE
:SETS
set SDIR=D:\SHRDATA\PROD\PROJECTS\BIN\scripts
set f=%TEMP%\weather.txt
set blatlog=D:\SHRDATA\PROD\PROJECTS\LOGS\blat.log
perl %SDIR%\weather.pl > %f%
blat %f% -subject "Weather Report" -to %email% -log %blatlog%
:: End of main
goto :EOF
:: /--------------------------------------------------------------------------/
:: HELP procedure
:: /--------------------------------------------------------------------------/
rem Display brief on-line help message
rem
:HELP
if defined TRACE %TRACE% [proc %0 %*]
rem Put help message here...
goto :EOF
:USAGE
echo usage: %0, %svn_rev%
echo %0
echo Description:
echo Call weather.pl script, redirect output to file and then email it to recipient
goto END
:: /--------------------------------------------------------------------------/
:: VERSION procedure
:: /--------------------------------------------------------------------------/
:VERSION
echo filename: %SCRIPTNAME%
echo $Id: tq.cmd 114 2005-04-25 13:59:09Z farley $
echo $Rev: 114 $
echo $LastChangedDate%
perl -v
goto END
:ERR1
echo %0: Err1:
goto END
:ERR2
echo %0: Err2:
goto END
:END
:DOSEXIT
echo This script requires Windows NT or later