mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-14 10:37:39 -07:00
Small fixes in add/delete ip functions
This commit is contained in:
parent
2f17fc8d01
commit
dffb7c3547
6 changed files with 12 additions and 23 deletions
|
@ -35,9 +35,6 @@ is_ip_key_empty '$U_WEB_DOMAINS'
|
|||
# Checking users on ip
|
||||
is_ip_key_empty '$U_SYS_USERS'
|
||||
|
||||
# We do not check ownership if
|
||||
# no one actualy use this ip
|
||||
|
||||
# Checking interface
|
||||
interface=$(get_current_interface)
|
||||
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
server {
|
||||
listen %ip%:%proxy_port% default;
|
||||
server_name _;
|
||||
server_name_in_redirect off;
|
||||
#access_log /var/log/nginx/%ip%.log main;
|
||||
|
||||
#access_log /var/log/nginx/%ip%.log main;
|
||||
location / {
|
||||
proxy_pass http://%ip%:%web_port%;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
server {
|
||||
listen %ip%:%proxy_ssl_port%;
|
||||
server_name %domain_idn% %alias_idn%;
|
||||
server_name_in_redirect off;
|
||||
ssl on;
|
||||
ssl_certificate %ssl_pem%;
|
||||
ssl_certificate_key %ssl_key%;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
server {
|
||||
listen %ip%:%proxy_port%;
|
||||
server_name %domain_idn% %alias_idn%;
|
||||
server_name_in_redirect off;
|
||||
%elog%error_log /var/log/httpd/domains/%domain%.error.log error;
|
||||
|
||||
location / {
|
||||
|
|
|
@ -600,33 +600,29 @@ dom_clear_list() {
|
|||
}
|
||||
|
||||
namehost_ip_support() {
|
||||
#Checking web system
|
||||
# Checking httpd config for NameHost string number
|
||||
if [ "$WEB_SYSTEM" = 'apache' ]; then
|
||||
|
||||
# Checking httpd config for NameHost string number
|
||||
conf_line=$(grep -n "NameVirtual" $conf|tail -n 1|cut -f 1 -d ':')
|
||||
if [ ! -z "$conf_line" ]; then
|
||||
conf_ins=$((conf_line + 1)) # inster into next line
|
||||
conf_ins=$((conf_line + 1))
|
||||
else
|
||||
conf_ins='1' # insert into first line
|
||||
conf_ins='1'
|
||||
fi
|
||||
|
||||
# Checking ssl support
|
||||
if [ "$WEB_SSL" = 'mod_ssl' ]; then
|
||||
web_ssl_port=$(get_config_value '$WEB_SSL_PORT')
|
||||
sed -i "$conf_ins i NameVirtualHost $ip:$web_ssl_port" $conf
|
||||
sed -i "$conf_ins i Listen $ip:$web_ssl_port" $conf
|
||||
sed -i "$conf_ins i NameVirtualHost $ip:$WEB_SSL_PORT" $conf
|
||||
sed -i "$conf_ins i Listen $ip:$WEB_SSL_PORT" $conf
|
||||
fi
|
||||
|
||||
web_port=$(get_config_value '$WEB_PORT')
|
||||
sed -i "$conf_ins i NameVirtualHost $ip:$web_port" $conf
|
||||
sed -i "$conf_ins i Listen $ip:$web_port" $conf
|
||||
sed -i "$conf_ins i NameVirtualHost $ip:$WEB_PORT" $conf
|
||||
sed -i "$conf_ins i Listen $ip:$WEB_PORT" $conf
|
||||
|
||||
# Checking proxy support
|
||||
if [ "$PROXY_SYSTEM" = 'nginx' ]; then
|
||||
proxy_port=$(get_config_value '$PROXY_PORT')
|
||||
cat $V_WEBTPL/ngingx_ip.tpl | sed -e "s/%ip%/$ip/g" \
|
||||
-e "s/%web_port%/$web_port/g" -e "s/%proxy_port%/$proxy_port/g" >>$nconf
|
||||
-e "s/%web_port%/$WEB_SSL_PORT/g" \
|
||||
-e "s/%proxy_port%/$PROXY_PORT/g" >>$nconf
|
||||
|
||||
# Adding to rpaf ip pool as well
|
||||
ips=$(grep 'RPAFproxy_ips' $rconf)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
is_sys_ip_free() {
|
||||
# Parsing system ips
|
||||
ip_list=$(ifconfig|grep 'inet addr:'|cut -f 2 -d ':'|cut -f 1 -d " ")
|
||||
ip_list=$(/sbin/ifconfig|grep 'inet addr:'|cut -f 2 -d ':'|cut -f 1 -d " ")
|
||||
|
||||
# Checking ip existance
|
||||
ip_check=$(echo "$ip_list"|grep -w "$ip")
|
||||
|
@ -13,7 +13,7 @@ is_sys_ip_free() {
|
|||
|
||||
get_next_interface_number() {
|
||||
# Parsing ifconfig
|
||||
i=$(ifconfig -a |grep -w "$interface"|cut -f1 -d ' '|\
|
||||
i=$(/sbin/ifconfig -a |grep -w "$interface"|cut -f1 -d ' '|\
|
||||
tail -n 1|cut -f 2 -d :)
|
||||
|
||||
# Checking result
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue