Skip to content

Commit d7f2dee

Browse files
author
Kristan Kenney
committed
Update unassigned IP address configuration
1 parent 3dff9d5 commit d7f2dee

File tree

3 files changed

+36
-48
lines changed

3 files changed

+36
-48
lines changed

install/hst-install-debian.sh

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,14 +1117,12 @@ if [ "$nginx" = 'yes' ]; then
11171117
fi
11181118

11191119
# Redirect unassigned hosts to default "Success" page
1120-
if [ -f /usr/local/hestia/data/ips/* ]; then
1121-
for ip in /usr/local/hestia/data/ips/*; do
1122-
ipaddr=${ip##*/}
1123-
rm -f /etc/nginx/conf.d/$ip.conf
1124-
cp -f $HESTIA/install/deb/nginx/unassigned.inc /etc/nginx/conf.d/$ipaddr.conf
1125-
sed -i 's/directIP/'$ipaddr'/g' /etc/nginx/conf.d/$ipaddr.conf
1126-
done
1127-
fi
1120+
for ip in /usr/local/hestia/data/ips/*; do
1121+
ipaddr=${ip##*/}
1122+
rm -f /etc/nginx/conf.d/$ip.conf
1123+
cp -f $HESTIA/install/deb/nginx/unassigned.inc /etc/nginx/conf.d/$ipaddr.conf
1124+
sed -i 's/directIP/'$ipaddr'/g' /etc/nginx/conf.d/$ipaddr.conf
1125+
done
11281126

11291127
# Install dhparam.
11301128
cp -f $HESTIA/install/deb/ssl/dhparam.pem /etc/ssl
@@ -1181,14 +1179,12 @@ if [ "$apache" = 'yes' ]; then
11811179
fi
11821180

11831181
# Add unassigned hosts configuration to apache2
1184-
if [ -f /usr/local/hestia/data/ips/* ]; then
1185-
for ip in /usr/local/hestia/data/ips/*; do
1186-
ipaddr=${ip##*/}
1187-
rm -f /etc/apache2/conf.d/$ip.conf
1188-
cp -f $HESTIA/install/deb/apache2/unassigned.conf /etc/apache2/conf.d/$ipaddr.conf
1189-
sed -i 's/directIP/'$ipaddr'/g' /etc/apache2/conf.d/$ipaddr.conf
1190-
done
1191-
fi
1182+
for ip in /usr/local/hestia/data/ips/*; do
1183+
ipaddr=${ip##*/}
1184+
rm -f /etc/apache2/conf.d/$ip.conf
1185+
cp -f $HESTIA/install/deb/apache2/unassigned.conf /etc/apache2/conf.d/$ipaddr.conf
1186+
sed -i 's/directIP/'$ipaddr'/g' /etc/apache2/conf.d/$ipaddr.conf
1187+
done
11921188

11931189
update-rc.d apache2 defaults > /dev/null 2>&1
11941190
service apache2 start >> $LOG

install/hst-install-ubuntu.sh

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,14 +1084,12 @@ if [ "$nginx" = 'yes' ]; then
10841084
fi
10851085

10861086
# Redirect unassigned hosts to default "Success" page
1087-
if [ -f /usr/local/hestia/data/ips/* ]; then
1088-
for ip in /usr/local/hestia/data/ips/*; do
1089-
ipaddr=${ip##*/}
1090-
rm -f /etc/nginx/conf.d/$ip.conf
1091-
cp -f $HESTIA/install/deb/nginx/unassigned.inc /etc/nginx/conf.d/$ipaddr.conf
1092-
sed -i 's/directIP/'$ipaddr'/g' /etc/nginx/conf.d/$ipaddr.conf
1093-
done
1094-
fi
1087+
for ip in /usr/local/hestia/data/ips/*; do
1088+
ipaddr=${ip##*/}
1089+
rm -f /etc/nginx/conf.d/$ip.conf
1090+
cp -f $HESTIA/install/deb/nginx/unassigned.inc /etc/nginx/conf.d/$ipaddr.conf
1091+
sed -i 's/directIP/'$ipaddr'/g' /etc/nginx/conf.d/$ipaddr.conf
1092+
done
10951093

10961094
# Install dhparam.
10971095
cp -f $HESTIA/install/deb/ssl/dhparam.pem /etc/ssl
@@ -1144,14 +1142,12 @@ if [ "$apache" = 'yes' ]; then
11441142
fi
11451143

11461144
# Add unassigned hosts configuration to apache2
1147-
if [ -f /usr/local/hestia/data/ips/* ]; then
1148-
for ip in /usr/local/hestia/data/ips/*; do
1149-
ipaddr=${ip##*/}
1150-
rm -f /etc/apache2/conf.d/$ip.conf
1151-
cp -f $HESTIA/install/deb/apache2/unassigned.conf /etc/apache2/conf.d/$ipaddr.conf
1152-
sed -i 's/directIP/'$ipaddr'/g' /etc/apache2/conf.d/$ipaddr.conf
1153-
done
1154-
fi
1145+
for ip in /usr/local/hestia/data/ips/*; do
1146+
ipaddr=${ip##*/}
1147+
rm -f /etc/apache2/conf.d/$ip.conf
1148+
cp -f $HESTIA/install/deb/apache2/unassigned.conf /etc/apache2/conf.d/$ipaddr.conf
1149+
sed -i 's/directIP/'$ipaddr'/g' /etc/apache2/conf.d/$ipaddr.conf
1150+
done
11551151

11561152
update-rc.d apache2 defaults > /dev/null 2>&1
11571153
service apache2 start >> $LOG

install/upgrade/0.10.0-190430.sh

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -156,25 +156,21 @@ fi
156156
# Add unassigned hosts configuration to Nginx and Apache
157157
if [ "$WEB_SYSTEM" = "apache2" ]; then
158158
echo "(*) Adding unassigned hosts configuration to Apache..."
159-
if [ -f /usr/local/hestia/data/ips/* ]; then
160-
for ip in /usr/local/hestia/data/ips/*; do
161-
ipaddr=${ip##*/}
162-
rm -f /etc/apache2/conf.d/$ip.conf
163-
cp -f $HESTIA/install/deb/apache2/unassigned.conf /etc/apache2/conf.d/$ipaddr.conf
164-
sed -i 's/directIP/'$ipaddr'/g' /etc/apache2/conf.d/$ipaddr.conf
165-
done
166-
fi
159+
for ip in /usr/local/hestia/data/ips/*; do
160+
ipaddr=${ip##*/}
161+
rm -f /etc/apache2/conf.d/$ip.conf
162+
cp -f $HESTIA/install/deb/apache2/unassigned.conf /etc/apache2/conf.d/$ipaddr.conf
163+
sed -i 's/directIP/'$ipaddr'/g' /etc/apache2/conf.d/$ipaddr.conf
164+
done
167165
fi
168166
if [ "$PROXY_SYSTEM" = "nginx" ]; then
169167
echo "(*) Adding unassigned hosts configuration to Nginx..."
170-
if [ -f /usr/local/hestia/data/ips/* ]; then
171-
for ip in /usr/local/hestia/data/ips/*; do
172-
ipaddr=${ip##*/}
173-
rm -f /etc/nginx/conf.d/$ip.conf
174-
cp -f $HESTIA/install/deb/nginx/unassigned.inc /etc/nginx/conf.d/$ipaddr.conf
175-
sed -i 's/directIP/'$ipaddr'/g' /etc/nginx/conf.d/$ipaddr.conf
176-
done
177-
fi
168+
for ip in /usr/local/hestia/data/ips/*; do
169+
ipaddr=${ip##*/}
170+
rm -f /etc/nginx/conf.d/$ip.conf
171+
cp -f $HESTIA/install/deb/nginx/unassigned.inc /etc/nginx/conf.d/$ipaddr.conf
172+
sed -i 's/directIP/'$ipaddr'/g' /etc/nginx/conf.d/$ipaddr.conf
173+
done
178174
fi
179175

180176
# Fix empty pool error message for MultiPHP

0 commit comments

Comments
 (0)