#!/bin/bash # Configure web.xml to use RemoteUserFilter for SSO set -e WEB_XML="/usr/local/tomcat/webapps/ROOT/WEB-INF/web.xml" MARKER="" echo "Configuring JSPWiki for Remote-User SSO..." >&2 # Check if already configured if grep -q "$MARKER" "$WEB_XML" 2>/dev/null; then echo "✓ RemoteUserFilter already configured" >&2 exit 0 fi # Add RemoteUserFilter configuration after opening tag completes # Find the line with version="5.0"> which closes the web-app opening tag sed -i '/version="5.0">/a\ \ \ \ \ RemoteUserFilter\ RemoteUserFilter\ \ \ RemoteUserFilter\ /*\ ' "$WEB_XML" echo "✓ RemoteUserFilter configured in web.xml" >&2