/*
 *
 * Simple Basic Exec module for Screws 
 *
 */

#include "modskel.h"


char *type="exec",  /* execution module */
     *name="BasicExec"; /* rutinary msg */

bool init() /* Init function */
{
	printf("[m] basic_exec enabled.\n");
	return true;
}

bool exec(char **opts) /* Exec function */
{
	char *raddr;
	raddr=(char *)getenv("REMOTE_ADDR");
	printf( "HTTP/1.1 200 OK\r\n"
		"Server: Screws exec wrapped\r\n"
		"Connection: close\r\n"
		"Content-Type: text/html\r\n\r\n"
		"<html><body><h1>Wrapped Hello</h1>"
		"Hello from %s.</body></html>\r\n",raddr);

	return true; /* Exec finishes here */
	return false; /* Do the native Exec */
}
