mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 18:49:21 -07:00
webip upgrade trigger
This commit is contained in:
parent
d751be61f2
commit
8e1686cbbf
1 changed files with 29 additions and 0 deletions
29
upd/convert_webip.sh
Executable file
29
upd/convert_webip.sh
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Include vesta.conf
|
||||
source /usr/local/vesta/conf/vesta.conf
|
||||
|
||||
# Remove ol ip definitions from vesta.conf
|
||||
sed -i "/^Listen/d" /etc/$WEB_SYSTEM/conf.d/vesta.conf
|
||||
sed -i "/^NameVirtualHost/d" /etc/$WEB_SYSTEM/conf.d/vesta.conf
|
||||
sed -i "/^$/d" /etc/$WEB_SYSTEM/conf.d/vesta.conf
|
||||
|
||||
# Create new ip configs
|
||||
for ip in $(ls /usr/local/vesta/data/ips); do
|
||||
web_conf="/etc/$WEB_SYSTEM/conf.d/$ip.conf"
|
||||
|
||||
if [ "$WEB_SYSTEM" = 'httpd' ] || [ "$WEB_SYSTEM" = 'apache2' ]; then
|
||||
echo "NameVirtualHost $ip:$WEB_PORT" > $web_conf
|
||||
echo "Listen $ip:$WEB_PORT" >> $web_conf
|
||||
fi
|
||||
|
||||
if [ "$WEB_SSL" = 'mod_ssl' ]; then
|
||||
echo "NameVirtualHost $ip:$WEB_SSL_PORT" >> $web_conf
|
||||
echo "Listen $ip:$WEB_SSL_PORT" >> $web_conf
|
||||
fi
|
||||
done
|
||||
|
||||
# Restart web server
|
||||
/usr/local/vesta/bin/v-restart-web
|
||||
|
||||
exit
|
Loading…
Add table
Add a link
Reference in a new issue