File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
guacamole-docker/environment/REMOTE_IP_VALVE_ Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change 29
29
# # RemoteIpValve attributes that correspond to various "REMOTE_IP_VALVE_*"
30
30
# # environment variables.
31
31
# #
32
- declare -a VALVE_ATTRIBUTES=( --type attr -n className -v org.apache.catalina.valves.RemoteIpValve )
32
+ declare -a VALVE_ATTRIBUTES=( --insert ' /Server/Service/Engine/Host/Valve[not(@className)] ' -- type attr -n className -v org.apache.catalina.valves.RemoteIpValve )
33
33
34
34
# Translate all properties supported by RemoteIpValve into corresponding
35
35
# environment variables
@@ -45,7 +45,7 @@ for ATTRIBUTE in \
45
45
46
46
VAR_NAME=" REMOTE_IP_VALVE_$( echo " $ATTRIBUTE " | sed ' s/\([a-z]\)\([A-Z]\)/\1_\2/g' | tr ' a-z' ' A-Z' ) "
47
47
if [ -n " ${! VAR_NAME} " ]; then
48
- VALVE_ATTRIBUTES+=( --type attr -n " $ATTRIBUTE " -v " ${! VAR_NAME} " )
48
+ VALVE_ATTRIBUTES+=( --insert ' /Server/Service/Engine/Host/Valve[@className="org.apache.catalina.valves.RemoteIpValve"] ' -- type attr -n " $ATTRIBUTE " -v " ${! VAR_NAME} " )
49
49
else
50
50
echo " Using default RemoteIpValve value for \" $ATTRIBUTE \" attribute."
51
51
fi
55
55
# Programmatically add requested RemoteIpValve entry
56
56
xmlstarlet edit --inplace \
57
57
--insert ' /Server/Service/Engine/Host/*' --type elem -n Valve \
58
- --insert ' /Server/Service/Engine/Host/Valve[not(@className)]' \
59
58
" ${VALVE_ATTRIBUTES[@]} " \
60
59
" $CATALINA_BASE /conf/server.xml"
61
60
You can’t perform that action at this time.
0 commit comments