Skip to content

Commit 8e1686c

Browse files
committed
webip upgrade trigger
1 parent d751be6 commit 8e1686c

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

upd/convert_webip.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
# Include vesta.conf
4+
source /usr/local/vesta/conf/vesta.conf
5+
6+
# Remove ol ip definitions from vesta.conf
7+
sed -i "/^Listen/d" /etc/$WEB_SYSTEM/conf.d/vesta.conf
8+
sed -i "/^NameVirtualHost/d" /etc/$WEB_SYSTEM/conf.d/vesta.conf
9+
sed -i "/^$/d" /etc/$WEB_SYSTEM/conf.d/vesta.conf
10+
11+
# Create new ip configs
12+
for ip in $(ls /usr/local/vesta/data/ips); do
13+
web_conf="/etc/$WEB_SYSTEM/conf.d/$ip.conf"
14+
15+
if [ "$WEB_SYSTEM" = 'httpd' ] || [ "$WEB_SYSTEM" = 'apache2' ]; then
16+
echo "NameVirtualHost $ip:$WEB_PORT" > $web_conf
17+
echo "Listen $ip:$WEB_PORT" >> $web_conf
18+
fi
19+
20+
if [ "$WEB_SSL" = 'mod_ssl' ]; then
21+
echo "NameVirtualHost $ip:$WEB_SSL_PORT" >> $web_conf
22+
echo "Listen $ip:$WEB_SSL_PORT" >> $web_conf
23+
fi
24+
done
25+
26+
# Restart web server
27+
/usr/local/vesta/bin/v-restart-web
28+
29+
exit

0 commit comments

Comments
 (0)