76 lines
2 KiB
PostScript
76 lines
2 KiB
PostScript
#-----------------------------------------------------------------------------
|
|
# File: ChangeWaitTimeAfterFailure.eps
|
|
#
|
|
# Changes the ID of the given file
|
|
#-----------------------------------------------------------------------------
|
|
|
|
@echo off;
|
|
|
|
if ($argc != 3) {
|
|
echo "Usage: $argv[0] <original_file> <WaitTimeAfterFailure>";
|
|
return false;
|
|
}
|
|
|
|
string $file = $argv[1];
|
|
string $WaitTimeAfterFailure = $argv[2];
|
|
|
|
|
|
#string $startHour = $argv[2];
|
|
#string $endHour = $argv[3];
|
|
|
|
@record on;
|
|
|
|
# get full path to original file
|
|
ifnot (`getdirectory -resources`) {
|
|
echo "* ChangeWaitTimeAfterFailure: Unable to get resources directory";
|
|
return false;
|
|
}
|
|
|
|
string $resDir = GetCmdData("dir");
|
|
ifnot (defined($resDir[0])) {
|
|
echo "* ChangeWaitTimeAfterFailure: Unable to retrieve resources directory";
|
|
return false;
|
|
}
|
|
|
|
# see if it's already a full path
|
|
string $fullPath;
|
|
string $parts = Split(":", $file);
|
|
if (sizeof($parts) > 1) {
|
|
# path is a full path
|
|
$fullPath = $file;
|
|
} else {
|
|
$fullPath = "$resDir\\$file";
|
|
}
|
|
|
|
# get logs directory
|
|
ifnot (`getdirectory -logs`) {
|
|
echo "* ChangeWaitTimeAfterFailure: Unable to get logs directory";
|
|
return false;
|
|
}
|
|
|
|
string $currentDir = GetCmdData("dir");
|
|
ifnot (defined($currentDir[0])) {
|
|
echo "* ChangeWaitTimeAfterFailure: Unable to retrieve logs directory";
|
|
return false;
|
|
}
|
|
|
|
# get filename
|
|
string $fileParts = Split("\\", $file);
|
|
int $lastPart = sizeof($fileParts);
|
|
$lastPart--;
|
|
string $fileName = $fileParts[$lastPart];
|
|
ifnot (defined($fileName[0])) {
|
|
echo "* ChangeWaitTimeAfterFailure: Unable to determine file name";
|
|
return false;
|
|
}
|
|
|
|
$fileName = "$currentDir\\$fileName-WTAF$WaitTimeAfterFailure";
|
|
|
|
# set the time
|
|
ifnot (`local run -command "$resDir\\PC\\Tools\\PCConfig.exe -proxy -inFile \\"$fullPath\\" -outFile \\"$fileName\\" -waitAfterFailure $WaitTimeAfterFailure"`) {
|
|
echo "* ChangeWaitTimeAfterFailure: Wait Time set failed";
|
|
return false;
|
|
}
|
|
|
|
echo "Wait Time After Failure set for $fileName";
|
|
return SetCmdData(STRING, "file", $fileName);
|