###############################################################################
#
# Open iT Patch definition
#


# Stop reporting server
stop
{
	error=warning
	module=reportingserver
}

# Wait for all previously signalled programs to stop
waitstop
{
	error=fatal
	timeout=60
	kill=no
}

linepatch
{
	error=warning
	target=%confdir%/httpd/httpd.conf
	instr1=find *<IfModule ssl_module>*
	instr2=insert Listen 127.0.0.1:8880
	instr3=insert <VirtualHost *:8080>
	instr4=insert 	ServerName SERVER_NAME
	instr5=insert 	Redirect permanent / https://SERVER_NAME:SERVER_PORT/
	instr6=insert </VirtualHost>
	instr7=insert
}

linepatch
{
	error=warning
	target=%confdir%/httpd/httpd-ssl.conf
	instr1=find *DocumentRoot "@@DocumentRoot@@"*
	instr2=replace DocumentRoot "%installdir%ReportingServer/html/"
	instr3=find *<Directory "@@ServerRoot@@/cgi-bin">*
	instr4=replace <Directory "%installdir%External/Apache/cgi-bin">
	instr5=find *CustomLog "@@ServerRoot@@/logs/ssl_request.log" \*
	instr6=replace CustomLog "%installdir%External/Apache/logs/ssl_request.log" \
	instr7=home
	instr8=find *SSLSessionCache        "shmcb:@@ServerRoot@@/logs/ssl_scache(512000)"*
	instr9=replace SSLSessionCache        "shmcb:SERVER_ROOT/logs/ssl_scache(512000)"
	instr10=find *ServerName @@ServerName@@*
	instr11=replace ServerName SERVER_NAME
	instr12=find *ServerAdmin @@ServerAdmin@@*
	instr13=replace ServerAdmin SERVER_ADMIN
}

# Update menus.xml
installfromdir
{
	error=fatal
	source=conf/
	target=%confdir%/
}


# Start reportingserver
start
{
	error=warning
	module=reportingserver
}