Skip to content

Commit 3aeec7c

Browse files
authored
Added check to see if mod_remoteip is installed
Sorry because I forgot to add it in previous commit
1 parent 579b1ac commit 3aeec7c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bin/v-add-sys-ip

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,10 @@ if [ ! -z "$PROXY_SYSTEM" ]; then
145145

146146
#mod_remoteip
147147
remoteip_conf="/etc/$WEB_SYSTEM/mods-enabled/remoteip.conf"
148-
if [ $( grep -ic "$ip" $remoteip_conf ) -eq 0 ]; then
149-
sed -i "s/<\/IfModule>/RemoteIPInternalProxy $ip\n<\/IfModule>/g" $remoteip_conf
148+
if [ -e "$remoteip_conf" ]; then
149+
if [ $( grep -ic "$ip" $remoteip_conf ) -eq 0 ]; then
150+
sed -i "s/<\/IfModule>/RemoteIPInternalProxy $ip\n<\/IfModule>/g" $remoteip_conf
151+
fi
150152
fi
151153
fi
152154

0 commit comments

Comments
 (0)