-
Notifications
You must be signed in to change notification settings - Fork 0
/
TS-GIS.pl
executable file
·110 lines (71 loc) · 2.1 KB
/
TS-GIS.pl
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
#!/usr/bin/perl -w
use strict;
my $Continue; my $Input;
my $Tail;
my $Date;
my $Len;
my $Target;
my $User=$ENV{"LOGNAME"};
while( ! $Continue ) {
print "What Tail do you want to process?\n";
print "-> ";
$Tail=<>;
chomp($Tail);
if ( $Tail !~ /^\d\d\d\d\d$/ ) {
print "Invalid Tail. Please try again.\n";
print "\n";
} else {
print "Processing Tail: $Tail\n";
print " Is this the one you want (Y/N)\n";
print "-> ";
$Input=<>;
chomp($Input);
$Continue=1 if (( $Input eq "Y" ) || ( $Input eq "y" ));
}
}
print "\n";
$Continue=0;
while( ! $Continue ) {
print "What Date do you want to process? ( Use the date format YYYYMMDD )\n";
print "-> ";
$Date=<>;
chomp($Date);
$Date =~ s/\///g;
if ( $Date !~ /^\d\d\d\d\d\d\d\d$/ ) {
print "Invalid Date. Please try again.\n";
print "\n";
} else {
print "Starting Date: $Date.\n";
print " Is this the one you want (Y/N)\n";
print "-> ";
$Input=<>;
chomp($Input);
$Continue=1 if (( $Input eq "Y" ) || ( $Input eq "y" ));
}
}
print "\n";
$Continue=0;
while( ! $Continue ) {
print "How many days of flights do you want to process? \n";
print "-> ";
$Len=<>;
chomp($Len);
print "Processing a duration of $Len\n";
print " Is this what you want? (Y/N) \n";
print "-> ";
$Input=<>;
chomp($Input);
$Continue=1 if (( $Input eq "Y" ) || ( $Input eq "y" ));
}
$Target="/tmp/GIS-".$User."-".$Tail.".kml";
print "\n";
print "Executing:\n";
print " /usr/bin/curl --data-urlencode \"tail=$Tail\" --data-urlencode \"date=$Date\" --data-urlencode \"days=$Len\" -d \"Submit=Submit\" http://performance.aircell.prod/reports/gis/ > $Target\n";
print "\n";
print " *** This might take a few minutes!\n";
system("/usr/bin/curl --data-urlencode \"tail=$Tail\" --data-urlencode \"date=$Date\" --data-urlencode \"days=$Len\" -d \"Submit=Submit\" http://performance.aircell.prod/reports/gis/ > $Target");
print "\n";
print "\n\n";
print "Your GIS file should be $Target, please retrieve it from balog01 using winscp to your local machien for processing.\n";
print "\n\n";
exit 0;