I am trying to create a perl script that will make sure a web page can be accessed going through an Apache httpd. The actual content of the web page does not matter. Most likely the web page will just have "You have successfully reached this port." This script will eventually be running... (5 Replies)
Hi everybody,
I'm currently writing a ksh script which automates the entire startup of a large number of Tibco BusinessWorks domains, as well as all the deployed components running on it.
My script is to be used after an infrastructure release, when the entire environement is down. It... (1 Reply)
I all,
I wrote an script which starts a Weblogic server and waits until its loaded to deploy several apps. The way I checked was something like:
while ; do
wget --spider <URL>:<port>/console > /dev/null 2>&1
rc=$?
done
This works perfectly because it's an HTML site and when server is... (2 Replies)
I have a server that keeps going down (503 Service not available). Until we find out the problem I would like to setup a simple ksh script in cron that will query url and report the status code. This way we can get someone to restart the process.
Does anyone know a simple command I can call... (5 Replies)
Hi. I'd like to have an IF-Then-Else statement where I can check to see if a file exists? We have the Bourne Shell by default. I'm looking for the syntax to do something like this:
if myfile.txt exists then
...my code
else
...my code
end if
Any help would be greatly... (5 Replies)
I want to write a script to see if various files exist. What I want to do is have the script search in various directories if a file exist, and if not, then output something like "/path/file does not exist". I don't actually know of how to check and see if a file exists or not. What I have in mind... (2 Replies)
Hi
#Testing for file existence
if ; then
echo 'SCHOOL data is available for processing'
else
echo 'SCHOOL DATA IS NOT AVAILABLE FOR PROCESSING'
:
i wrote a script, where it begins by checking if file exists or not.
If it exists, it truncates the database... (2 Replies)
In a Shell Script what is the most generic way to find in the PID exists or not.
If it does not exist how can I echo the user "PID does not exist" & terminate the unix script ?
If the command can work on most flavors of operating system the more useful I will find it to be.
Current system... (16 Replies)
Hi,
I have the below code written. However I am not getting the desired output
I am checking if the particular path has file in it.
#!/bin/bash
ls -l /IRS2/IRS2_ODI/INFILE/*LS* 1>/dev/null 2>/dev/null
if
then
echo $?
echo "File Exists"
fi
... (3 Replies)
Discussion started by: Shanmugapriya D
3 Replies
LEARN ABOUT DEBIAN
ns_urltofile
Ns_UrlToFile(3aolserver) AOLserver Library Procedures Ns_UrlToFile(3aolserver)__________________________________________________________________________________________________________________________________________________NAME
Ns_SetUrlToFileProc, Ns_UrlIsDir, Ns_UrlIsFile, Ns_UrlToFile - URL to file mapping procedures
SYNOPSIS
#include "ns.h"
void
Ns_SetUrlToFileProc(char *server, Ns_UrlToFileProc *procPtr)
int
Ns_UrlIsDir(char *server, char *url)
int
Ns_UrlIsFile(char *server, char *url)
int
Ns_UrlToFile(Ns_DString *dsPtr, char *server, char *url)
_________________________________________________________________DESCRIPTION
These functions map URL paths to real files and directories. They are normally used to determine whether a given URL has a corresponding
file or directory and to return the real filesystem path that corresponds to the URL.
Ns_SetUrlToFileProc(server, procPtr)
Set a pointer to a custom routine to use in place of Ns_UrlToFile.
Ns_UrlIsDir(server, url)
Construct a directory name by appending the URL to the current AOLserver pages directory for the specified server. Return NS_TRUE if
the directory exists; NS_FALSE otherwise.
Ns_UrlIsFile(server, url)
Construct a file name by appending the URL to the current AOLserver pages directory for the specified server. Return NS_TRUE if the
file exists and is a regular file; NS_FALSE otherwise.
Example:
/* IsFile - Simple request to determine if an URL is a file. */
int
IsFile(Ns_Conn *conn, void *ctx)
{
int isfile;
char *server;
server = Ns_ConnServer(conn);
isfile = Ns_UrlIsFile(server, conn->request->url);
if (isfile) {
Ns_ConnReturnNotice(conn, 200, "File", NULL);
} else {
Ns_ConnReturnNotice(conn, 200, "Not a File", NULL);
}
return NS_OK;
}
Ns_UrlToFile(dsPtr, server, url)
The Ns_UrlToFile function writes the full path name of the file corresponding to the given URL. The result is appended to the
Ns_DString. The function does not check that the file exists or is readable by the AOLserver process. This function returns a status
of NS_OK or NS_ERROR.
Normally this prepends the pageroot to the URL path. If you have created your own custom routine and used Ns_SetUrlToFileProc to
point to it, your routine is called instead. This could be used to create, for example, a module that takes the given URL and maps
it to a file in a different way than the default Ns_UrlToFile routine.
Example:
/* A simple page fetch request function. */
int
SimpleFetch(Ns_Conn *conn, void *ctx)
{
Ns_DString ds;
FILE fp;
char *server;
Ns_DStringInit(&ds);
server = Ns_ConnServer(conn);
Ns_UrlToFile(&ds, server, conn->request->url);
fp = fopen(ds.string, "r");
Ns_ConnSendOpenFp(conn, fp, -1);
fclose(fp);
Ns_DStringFree(&ds);
return NS_OK;
}
SEE ALSO nsd(1), info(n)
KEYWORDS AOLserver 4.0 Ns_UrlToFile(3aolserver)