From 3aeec7ce74c06c9f888372cdf59840331ffca78b Mon Sep 17 00:00:00 2001 From: dpeca Date: Wed, 26 Oct 2016 04:15:27 +0200 Subject: [PATCH] Added check to see if mod_remoteip is installed Sorry because I forgot to add it in previous commit --- bin/v-add-sys-ip | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/v-add-sys-ip b/bin/v-add-sys-ip index 4948996e..f278763b 100755 --- a/bin/v-add-sys-ip +++ b/bin/v-add-sys-ip @@ -145,8 +145,10 @@ if [ ! -z "$PROXY_SYSTEM" ]; then #mod_remoteip remoteip_conf="/etc/$WEB_SYSTEM/mods-enabled/remoteip.conf" - if [ $( grep -ic "$ip" $remoteip_conf ) -eq 0 ]; then - sed -i "s/<\/IfModule>/RemoteIPInternalProxy $ip\n<\/IfModule>/g" $remoteip_conf + if [ -e "$remoteip_conf" ]; then + if [ $( grep -ic "$ip" $remoteip_conf ) -eq 0 ]; then + sed -i "s/<\/IfModule>/RemoteIPInternalProxy $ip\n<\/IfModule>/g" $remoteip_conf + fi fi fi