Przeglądaj źródła

Change $VESTA to $HESTIA var.

Raphael Schneeberger 7 lat temu
rodzic
commit
172e3b88ee
6 zmienionych plików z 81 dodań i 81 usunięć
  1. 14 14
      func/db.sh
  2. 6 6
      func/domain.sh
  3. 23 23
      func/ip.sh
  4. 19 19
      func/main.sh
  5. 14 14
      func/rebuild.sh
  6. 5 5
      func/remote.sh

+ 14 - 14
func/db.sh

@@ -1,6 +1,6 @@
 # MySQL
 mysql_connect() {
-    host_str=$(grep "HOST='$1'" $VESTA/conf/mysql.conf)
+    host_str=$(grep "HOST='$1'" $HESTIA/conf/mysql.conf)
     eval $host_str
     if [ -z $HOST ] || [ -z $USER ] || [ -z $PASSWORD ]; then
         echo "Error: mysql config parsing failed"
@@ -8,7 +8,7 @@ mysql_connect() {
         exit $E_PARSING
     fi
 
-    mycnf="$VESTA/conf/.mysql.$HOST"
+    mycnf="$HESTIA/conf/.mysql.$HOST"
     if [ ! -e "$mycnf" ]; then
         echo "[client]">$mycnf
         echo "host='$HOST'" >> $mycnf
@@ -70,7 +70,7 @@ mysql_dump() {
 
 # PostgreSQL
 psql_connect() {
-    host_str=$(grep "HOST='$1'" $VESTA/conf/pgsql.conf)
+    host_str=$(grep "HOST='$1'" $HESTIA/conf/pgsql.conf)
     eval $host_str
     export PGPASSWORD="$PASSWORD"
     if [ -z $HOST ] || [ -z $USER ] || [ -z $PASSWORD ] || [ -z $TPL ]; then
@@ -117,7 +117,7 @@ get_next_dbhost() {
     if [ -z "$host" ] || [ "$host" == 'default' ]; then
         IFS=$'\n'
         host='EMPTY_DB_HOST'
-        config="$VESTA/conf/$type.conf"
+        config="$HESTIA/conf/$type.conf"
         host_str=$(grep "SUSPENDED='no'" $config)
         check_row=$(echo "$host_str"|wc -l)
 
@@ -146,7 +146,7 @@ get_next_dbhost() {
 
 # Database charset validation
 is_charset_valid() {
-    host_str=$(grep "HOST='$host'" $VESTA/conf/$type.conf)
+    host_str=$(grep "HOST='$host'" $HESTIA/conf/$type.conf)
     eval $host_str
 
     if [ -z "$(echo $CHARSETS | grep -wi $charset )" ]; then
@@ -158,7 +158,7 @@ is_charset_valid() {
 
 # Increase database host value
 increase_dbhost_values() {
-    host_str=$(grep "HOST='$host'" $VESTA/conf/$type.conf)
+    host_str=$(grep "HOST='$host'" $HESTIA/conf/$type.conf)
     eval $host_str
 
     old_dbbases="U_DB_BASES='$U_DB_BASES'"
@@ -175,13 +175,13 @@ increase_dbhost_values() {
         fi
     fi
 
-    sed -i "s/$old_dbbases/$new_dbbases/g" $VESTA/conf/$type.conf
-    sed -i "s/$old_users/$new_users/g" $VESTA/conf/$type.conf
+    sed -i "s/$old_dbbases/$new_dbbases/g" $HESTIA/conf/$type.conf
+    sed -i "s/$old_users/$new_users/g" $HESTIA/conf/$type.conf
 }
 
 # Decrease database host value
 decrease_dbhost_values() {
-    host_str=$(grep "HOST='$HOST'" $VESTA/conf/$TYPE.conf)
+    host_str=$(grep "HOST='$HOST'" $HESTIA/conf/$TYPE.conf)
     eval $host_str
 
     old_dbbases="U_DB_BASES='$U_DB_BASES'"
@@ -194,8 +194,8 @@ decrease_dbhost_values() {
         sed ':a;N;$!ba;s/\n/,/g')
     new_users="U_SYS_USERS='$U_SYS_USERS'"
 
-    sed -i "s/$old_dbbases/$new_dbbases/g" $VESTA/conf/$TYPE.conf
-    sed -i "s/$old_users/$new_users/g" $VESTA/conf/$TYPE.conf
+    sed -i "s/$old_dbbases/$new_dbbases/g" $HESTIA/conf/$TYPE.conf
+    sed -i "s/$old_users/$new_users/g" $HESTIA/conf/$TYPE.conf
 }
 
 # Create MySQL database
@@ -249,8 +249,8 @@ add_pgsql_database() {
 
 # Check if database host do not exist in config 
 is_dbhost_new() {
-    if [ -e "$VESTA/conf/$type.conf" ]; then
-        check_host=$(grep "HOST='$host'" $VESTA/conf/$type.conf)
+    if [ -e "$HESTIA/conf/$type.conf" ]; then
+        check_host=$(grep "HOST='$host'" $HESTIA/conf/$type.conf)
         if [ ! -z "$check_host" ]; then
             echo "Error: db host exist"
             log_event "$E_EXISTS" "$ARGUMENTS"
@@ -363,7 +363,7 @@ dump_pgsql_database() {
 
 # Check if database server is in use
 is_dbhost_free() {
-    host_str=$(grep "HOST='$host'" $VESTA/conf/$type.conf)
+    host_str=$(grep "HOST='$host'" $HESTIA/conf/$type.conf)
     eval $host_str
     if [ 0 -ne "$U_DB_BASES" ]; then
         echo "Error: host $HOST is used"

+ 6 - 6
func/domain.sh

@@ -35,7 +35,7 @@ is_backend_template_valid() {
 
 # Web domain existence check
 is_web_domain_new() {
-    web=$(grep -F -H "DOMAIN='$1'" $VESTA/data/users/*/web.conf)
+    web=$(grep -F -H "DOMAIN='$1'" $HESTIA/data/users/*/web.conf)
     if [ ! -z "$web" ]; then
         if [ "$type" == 'web' ]; then
             check_result $E_EXISTS "Web domain $1 exist"
@@ -49,7 +49,7 @@ is_web_domain_new() {
 
 # Web alias existence check
 is_web_alias_new() {
-    web_alias=$(grep -wH "$1" $VESTA/data/users/*/web.conf)
+    web_alias=$(grep -wH "$1" $HESTIA/data/users/*/web.conf)
     if [ ! -z "$web_alias" ]; then
         a1=$(echo "$web_alias" |grep -F "'$1'" |cut -f 7 -d /)
         if [ ! -z "$a1" ] && [ "$2" == "web"  ]; then
@@ -160,8 +160,8 @@ prepare_web_domain_values() {
         ssl_ca_str='#'
     fi
     if [ "$SUSPENDED" = 'yes' ]; then
-        docroot="$VESTA/data/templates/web/suspend"
-        sdocroot="$VESTA/data/templates/web/suspend"
+        docroot="$HESTIA/data/templates/web/suspend"
+        sdocroot="$HESTIA/data/templates/web/suspend"
     fi
 }
 
@@ -360,7 +360,7 @@ is_dns_template_valid() {
 
 # DNS domain existence check
 is_dns_domain_new() {
-    dns=$(ls $VESTA/data/users/*/dns/$1.conf 2>/dev/null)
+    dns=$(ls $HESTIA/data/users/*/dns/$1.conf 2>/dev/null)
     if [ ! -z "$dns" ]; then
         if [ "$2" == 'dns' ]; then
             check_result $E_EXISTS "DNS domain $1 exists"
@@ -515,7 +515,7 @@ is_dns_nameserver_valid() {
 
 # Mail domain existence check
 is_mail_domain_new() {
-    mail=$(ls $VESTA/data/users/*/mail/$1.conf 2>/dev/null)
+    mail=$(ls $HESTIA/data/users/*/mail/$1.conf 2>/dev/null)
     if [ ! -z "$mail" ]; then
         if [ "$2" == 'mail' ]; then
             check_result $E_EXISTS "Mail domain $1 exists"

+ 23 - 23
func/ip.sh

@@ -1,6 +1,6 @@
 # Check ip ownership
 is_ip_owner() {
-    owner=$(grep 'OWNER=' $VESTA/data/ips/$ip |cut -f 2 -d \')
+    owner=$(grep 'OWNER=' $HESTIA/data/ips/$ip |cut -f 2 -d \')
     if [ "$owner" != "$user" ]; then
         check_result $E_FORBIDEN "$ip is not owned by $user"
     fi
@@ -8,7 +8,7 @@ is_ip_owner() {
 
 # Check if ip address is free
 is_ip_free() {
-    if [ -e "$VESTA/data/ips/$ip" ]; then
+    if [ -e "$HESTIA/data/ips/$ip" ]; then
         check_result $E_EXISTS "$ip is already exists"
     fi
 }
@@ -29,7 +29,7 @@ get_ip_iface() {
 # Check ip address specific value
 is_ip_key_empty() {
     key="$1"
-    string=$(cat $VESTA/data/ips/$ip)
+    string=$(cat $HESTIA/data/ips/$ip)
     eval $string
     eval value="$key"
     if [ ! -z "$value" ] && [ "$value" != '0' ]; then
@@ -42,7 +42,7 @@ is_ip_key_empty() {
 update_ip_value() {
     key="$1"
     value="$2"
-    conf="$VESTA/data/ips/$ip"
+    conf="$HESTIA/data/ips/$ip"
     str=$(cat $conf)
     eval $str
     c_key=$(echo "${key//$/}")
@@ -55,7 +55,7 @@ update_ip_value() {
 
 # Get ip name
 get_ip_alias() {
-    ip_name=$(grep "NAME=" $VESTA/data/ips/$local_ip |cut -f 2 -d \')
+    ip_name=$(grep "NAME=" $HESTIA/data/ips/$local_ip |cut -f 2 -d \')
     if [ ! -z "$ip_name" ]; then
         echo "${1//./-}.$ip_name"
     fi
@@ -67,8 +67,8 @@ increase_ip_value() {
     USER=$user
     web_key='U_WEB_DOMAINS'
     usr_key='U_SYS_USERS'
-    current_web=$(grep "$web_key=" $VESTA/data/ips/$sip |cut -f 2 -d \')
-    current_usr=$(grep "$usr_key=" $VESTA/data/ips/$sip |cut -f 2 -d \')
+    current_web=$(grep "$web_key=" $HESTIA/data/ips/$sip |cut -f 2 -d \')
+    current_usr=$(grep "$usr_key=" $HESTIA/data/ips/$sip |cut -f 2 -d \')
     if [ -z "$current_web" ]; then
         echo "Error: Parsing error"
         log_event "$E_PARSING" "$ARGUMENTS"
@@ -87,9 +87,9 @@ increase_ip_value() {
     fi
 
     sed -i "s/$web_key='$current_web'/$web_key='$new_web'/g" \
-        $VESTA/data/ips/$sip
+        $HESTIA/data/ips/$sip
     sed -i "s/$usr_key='$current_usr'/$usr_key='$new_usr'/g" \
-        $VESTA/data/ips/$sip
+        $HESTIA/data/ips/$sip
 }
 
 # Decrease ip value
@@ -99,8 +99,8 @@ decrease_ip_value() {
     web_key='U_WEB_DOMAINS'
     usr_key='U_SYS_USERS'
 
-    current_web=$(grep "$web_key=" $VESTA/data/ips/$sip |cut -f 2 -d \')
-    current_usr=$(grep "$usr_key=" $VESTA/data/ips/$sip |cut -f 2 -d \')
+    current_web=$(grep "$web_key=" $HESTIA/data/ips/$sip |cut -f 2 -d \')
+    current_usr=$(grep "$usr_key=" $HESTIA/data/ips/$sip |cut -f 2 -d \')
 
     if [ -z "$current_web" ]; then
         check_result $E_PARSING "Parsing error"
@@ -119,15 +119,15 @@ decrease_ip_value() {
     fi
 
     sed -i "s/$web_key='$current_web'/$web_key='$new_web'/g" \
-        $VESTA/data/ips/$sip
+        $HESTIA/data/ips/$sip
     sed -i "s/$usr_key='$current_usr'/$usr_key='$new_usr'/g" \
-        $VESTA/data/ips/$sip
+        $HESTIA/data/ips/$sip
 }
 
 # Get ip address value
 get_ip_value() {
     key="$1"
-    string=$(cat $VESTA/data/ips/$ip)
+    string=$(cat $HESTIA/data/ips/$ip)
     eval $string
     eval value="$key"
     echo "$value"
@@ -136,10 +136,10 @@ get_ip_value() {
 
 # Get real ip address
 get_real_ip() {
-    if [ -e "$VESTA/data/ips/$1" ]; then
+    if [ -e "$HESTIA/data/ips/$1" ]; then
         echo $1
     else
-        nat=$(grep -H "^NAT='$1'" $VESTA/data/ips/*)
+        nat=$(grep -H "^NAT='$1'" $HESTIA/data/ips/*)
         if [ ! -z "$nat" ]; then
             echo "$nat" |cut -f 1 -d : |cut -f 7 -d /
         fi
@@ -195,9 +195,9 @@ get_broadcast() {
 
 # Get user ips
 get_user_ips() {
-    dedicated=$(grep -H "OWNER='$user'" $VESTA/data/ips/*)
+    dedicated=$(grep -H "OWNER='$user'" $HESTIA/data/ips/*)
     dedicated=$(echo "$dedicated" |cut -f 1 -d : |sed 's=.*/==')
-    shared=$(grep -H -A1 "OWNER='admin'" $VESTA/data/ips/* |grep shared)
+    shared=$(grep -H -A1 "OWNER='admin'" $HESTIA/data/ips/* |grep shared)
     shared=$(echo "$shared" |cut -f 1 -d : |sed 's=.*/==' |cut -f 1 -d \-)
     for dedicated_ip in $dedicated; do
         shared=$(echo "$shared" |grep -v $dedicated_ip)
@@ -212,7 +212,7 @@ get_user_ip() {
         check_result $E_NOTEXIST "no IP is available"
     fi
     local_ip=$ip
-    nat=$(grep "^NAT" $VESTA/data/ips/$ip |cut -f 2 -d \')
+    nat=$(grep "^NAT" $HESTIA/data/ips/$ip |cut -f 2 -d \')
     if [ ! -z "$nat" ]; then
         ip=$nat
     fi
@@ -221,8 +221,8 @@ get_user_ip() {
 # Validate ip address
 is_ip_valid() {
     local_ip="$1"
-    if [ ! -e "$VESTA/data/ips/$1" ]; then
-        nat=$(grep -H "^NAT='$1'" $VESTA/data/ips/*)
+    if [ ! -e "$HESTIA/data/ips/$1" ]; then
+        nat=$(grep -H "^NAT='$1'" $HESTIA/data/ips/*)
         if [ -z "$nat" ]; then
             check_result $E_NOTEXIST "IP $1 doesn't exist"
         else
@@ -232,9 +232,9 @@ is_ip_valid() {
     fi
     if [ ! -z $2 ]; then
         if [ -z "$nat" ]; then
-            ip_data=$(cat $VESTA/data/ips/$1)
+            ip_data=$(cat $HESTIA/data/ips/$1)
         else
-            ip_data=$(cat $VESTA/data/ips/$nat)
+            ip_data=$(cat $HESTIA/data/ips/$nat)
         fi
         ip_owner=$(echo "$ip_data" |grep OWNER= |cut -f2 -d \')
         ip_status=$(echo "$ip_data" |grep STATUS= |cut -f2 -d \')

+ 19 - 19
func/main.sh

@@ -6,12 +6,12 @@ BACKUP_GZIP=9
 BACKUP_DISK_LIMIT=95
 BACKUP_LA_LIMIT=5
 RRD_STEP=300
-BIN=$VESTA/bin
-USER_DATA=$VESTA/data/users/$user
-WEBTPL=$VESTA/data/templates/web
-DNSTPL=$VESTA/data/templates/dns
-RRD=$VESTA/web/rrd
-SENDMAIL="$VESTA/web/inc/mail-wrapper.php"
+BIN=$HESTIA/bin
+USER_DATA=$HESTIA/data/users/$user
+WEBTPL=$HESTIA/data/templates/web
+DNSTPL=$HESTIA/data/templates/dns
+RRD=$HESTIA/web/rrd
+SENDMAIL="$HESTIA/web/inc/mail-wrapper.php"
 
 # Return codes
 OK=0
@@ -53,9 +53,9 @@ log_event() {
         LOG_TIME="$date $time $(basename $0)"
     fi
     if [ "$1" -eq 0 ]; then
-        echo "$LOG_TIME $2" >> $VESTA/log/system.log
+        echo "$LOG_TIME $2" >> $HESTIA/log/system.log
     else
-        echo "$LOG_TIME $2 [Error $1]" >> $VESTA/log/error.log
+        echo "$LOG_TIME $2 [Error $1]" >> $HESTIA/log/error.log
     fi
 }
 
@@ -64,7 +64,7 @@ log_history() {
     cmd=$1
     undo=${2-no}
     log_user=${3-$user}
-    log=$VESTA/data/users/$log_user/history.log
+    log=$HESTIA/data/users/$log_user/history.log
     touch $log
     if [ '99' -lt "$(wc -l $log |cut -f 1 -d ' ')" ]; then
         tail -n 49 $log > $log.moved
@@ -163,7 +163,7 @@ generate_password() {
 # Package existence check
 is_package_valid() {
     if [ -z "$1" ]; then
-        pkg_dir="$VESTA/data/packages"
+        pkg_dir="$HESTIA/data/packages"
     fi
     if [ ! -e "$pkg_dir/$package.pkg" ]; then
         check_result $E_NOTEXIST "package $package doesn't exist"
@@ -187,8 +187,8 @@ is_backup_enabled() {
 
 # Check user backup settings
 is_backup_scheduled() {
-    if [ -e "$VESTA/data/queue/backup.pipe" ]; then
-        check_q=$(grep " $user " $VESTA/data/queue/backup.pipe | grep $1)
+    if [ -e "$HESTIA/data/queue/backup.pipe" ]; then
+        check_q=$(grep " $user " $HESTIA/data/queue/backup.pipe | grep $1)
         if [ ! -z "$check_q" ]; then
             check_result $E_EXISTS "$1 is already scheduled"
         fi
@@ -212,11 +212,11 @@ is_object_new() {
 # Check if object is valid
 is_object_valid() {
     if [ $2 = 'USER' ]; then
-        if [ ! -d "$VESTA/data/users/$3" ]; then
+        if [ ! -d "$HESTIA/data/users/$3" ]; then
             check_result $E_NOTEXIST "$1 $3 doesn't exist"
         fi
     else
-        object=$(grep "$2='$3'" $VESTA/data/users/$user/$1.conf)
+        object=$(grep "$2='$3'" $HESTIA/data/users/$user/$1.conf)
         if [ -z "$object" ]; then
             arg1=$(basename $1)
             arg2=$(echo $2 |tr '[:upper:]' '[:lower:]')
@@ -344,10 +344,10 @@ get_user_value() {
 # Update user value in user.conf
 update_user_value() {
     key="${2//$}"
-    lnr=$(grep -n "^$key='" $VESTA/data/users/$1/user.conf |cut -f 1 -d ':')
+    lnr=$(grep -n "^$key='" $HESTIA/data/users/$1/user.conf |cut -f 1 -d ':')
     if [ ! -z "$lnr" ]; then
-        sed -i "$lnr d" $VESTA/data/users/$1/user.conf
-        sed -i "$lnr i\\$key='${3}'" $VESTA/data/users/$1/user.conf
+        sed -i "$lnr d" $HESTIA/data/users/$1/user.conf
+        sed -i "$lnr i\\$key='${3}'" $HESTIA/data/users/$1/user.conf
     fi
 }
 
@@ -355,7 +355,7 @@ update_user_value() {
 increase_user_value() {
     key="${2//$}"
     factor="${3-1}"
-    conf="$VESTA/data/users/$1/user.conf"
+    conf="$HESTIA/data/users/$1/user.conf"
     old=$(grep "$key=" $conf | cut -f 2 -d \')
     if [ -z "$old" ]; then
         old=0
@@ -368,7 +368,7 @@ increase_user_value() {
 decrease_user_value() {
     key="${2//$}"
     factor="${3-1}"
-    conf="$VESTA/data/users/$1/user.conf"
+    conf="$HESTIA/data/users/$1/user.conf"
     old=$(grep "$key=" $conf | cut -f 2 -d \')
     if [ -z "$old" ]; then
         old=0

+ 14 - 14
func/rebuild.sh

@@ -15,8 +15,8 @@ rebuild_user_conf() {
     chmod 660 $USER_DATA/stats.log
 
     # Run template trigger
-    if [ -x "$VESTA/data/packages/$PACKAGE.sh" ]; then
-        $VESTA/data/packages/$PACKAGE.sh "$user" "$CONTACT" "$FNAME" "$LNAME"
+    if [ -x "$HESTIA/data/packages/$PACKAGE.sh" ]; then
+        $HESTIA/data/packages/$PACKAGE.sh "$user" "$CONTACT" "$FNAME" "$LNAME"
     fi
 
     # Rebuild user
@@ -55,8 +55,8 @@ rebuild_user_conf() {
     chown root:root $HOMEDIR/$user/conf
 
     # Update disk pipe
-    sed -i "/ $user$/d" $VESTA/data/queue/disk.pipe
-    echo "$BIN/v-update-user-disk $user" >> $VESTA/data/queue/disk.pipe
+    sed -i "/ $user$/d" $HESTIA/data/queue/disk.pipe
+    echo "$BIN/v-update-user-disk $user" >> $HESTIA/data/queue/disk.pipe
 
     # WEB
     if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB_SYSTEM" != 'no' ]; then
@@ -64,12 +64,12 @@ rebuild_user_conf() {
         chmod 770 $USER_DATA/ssl
         touch $USER_DATA/web.conf
         chmod 660 $USER_DATA/web.conf
-        if [ "$(grep -w $user $VESTA/data/queue/traffic.pipe)" ]; then
+        if [ "$(grep -w $user $HESTIA/data/queue/traffic.pipe)" ]; then
             echo "$BIN/v-update-web-domains-traff $user" \
-                >> $VESTA/data/queue/traffic.pipe
+                >> $HESTIA/data/queue/traffic.pipe
         fi
         echo "$BIN/v-update-web-domains-disk $user" \
-            >> $VESTA/data/queue/disk.pipe
+            >> $HESTIA/data/queue/disk.pipe
 
         if [[ -L "$HOMEDIR/$user/web" ]]; then
             rm $HOMEDIR/$user/web
@@ -106,7 +106,7 @@ rebuild_user_conf() {
         touch $USER_DATA/mail.conf
         chmod 660 $USER_DATA/mail.conf
         echo "$BIN/v-update-mail-domains-disk $user" \
-            >> $VESTA/data/queue/disk.pipe
+            >> $HESTIA/data/queue/disk.pipe
 
         if [[ -L "$HOMEDIR/$user/mail" ]]; then
             rm $HOMEDIR/$user/mail
@@ -124,7 +124,7 @@ rebuild_user_conf() {
     if [ ! -z "$DB_SYSTEM" ] && [ "$DB_SYSTEM" != 'no' ]; then
         touch $USER_DATA/db.conf
         chmod 660 $USER_DATA/db.conf
-        echo "$BIN/v-update-databases-disk $user" >> $VESTA/data/queue/disk.pipe
+        echo "$BIN/v-update-databases-disk $user" >> $HESTIA/data/queue/disk.pipe
 
         if [ -z "$create_user" ]; then
             $BIN/v-rebuild-databases $user
@@ -253,9 +253,9 @@ rebuild_web_domain_conf() {
         fi
 
         webstats="$BIN/v-update-web-domain-stat $user $domain"
-        check_webstats=$(grep "$webstats" $VESTA/data/queue/webstats.pipe)
+        check_webstats=$(grep "$webstats" $HESTIA/data/queue/webstats.pipe)
         if [ -z "$check_webstats" ]; then
-            echo "$webstats" >> $VESTA/data/queue/webstats.pipe
+            echo "$webstats" >> $HESTIA/data/queue/webstats.pipe
         fi
 
         if [ ! -z "$STATS_USER" ]; then
@@ -576,7 +576,7 @@ rebuild_mysql_database() {
 # Rebuild PostgreSQL
 rebuild_pgsql_database() {
 
-    host_str=$(grep "HOST='$HOST'" $VESTA/conf/pgsql.conf)
+    host_str=$(grep "HOST='$HOST'" $HESTIA/conf/pgsql.conf)
     eval $host_str
     export PGPASSWORD="$PASSWORD"
     if [ -z $HOST ] || [ -z $USER ] || [ -z $PASSWORD ] || [ -z $TPL ]; then
@@ -625,7 +625,7 @@ rebuild_pgsql_database() {
 # Import MySQL dump
 import_mysql_database() {
 
-    host_str=$(grep "HOST='$HOST'" $VESTA/conf/mysql.conf)
+    host_str=$(grep "HOST='$HOST'" $HESTIA/conf/mysql.conf)
     eval $host_str
     if [ -z $HOST ] || [ -z $USER ] || [ -z $PASSWORD ]; then
         echo "Error: mysql config parsing failed"
@@ -640,7 +640,7 @@ import_mysql_database() {
 # Import PostgreSQL dump
 import_pgsql_database() {
 
-    host_str=$(grep "HOST='$HOST'" $VESTA/conf/pgsql.conf)
+    host_str=$(grep "HOST='$HOST'" $HESTIA/conf/pgsql.conf)
     eval $host_str
     export PGPASSWORD="$PASSWORD"
     if [ -z $HOST ] || [ -z $USER ] || [ -z $PASSWORD ] || [ -z $TPL ]; then

+ 5 - 5
func/remote.sh

@@ -47,9 +47,9 @@ send_ssh_cmd() {
     fi
 
     if [ "$USER" = 'root' ]; then
-        args="$VESTA/bin/$1 \"$2\" \"$3\" \"$4\" \"$5\""
+        args="$HESTIA/bin/$1 \"$2\" \"$3\" \"$4\" \"$5\""
     else
-        args="sudo $VESTA/bin/$1 \"$2\" \"$3\" \"$4\" \"$5\""
+        args="sudo $HESTIA/bin/$1 \"$2\" \"$3\" \"$4\" \"$5\""
     fi
     ssh -i $IDENTITY_FILE $USER@$HOST -p $PORT "$args" > /dev/null 2>&1
     if [ "$?" -ne '0' ]; then
@@ -72,8 +72,8 @@ send_scp_file() {
 }
 
 is_dnshost_new() {
-    if [ -e "$VESTA/conf/dns-cluster.conf" ]; then
-        check_host=$(grep "HOST='$host'" $VESTA/conf/dns-cluster.conf)
+    if [ -e "$HESTIA/conf/dns-cluster.conf" ]; then
+        check_host=$(grep "HOST='$host'" $HESTIA/conf/dns-cluster.conf)
         if [ ! -z "$check_host" ]; then
             check_result $E_EXISTS "remote dns host $host exists"
         fi
@@ -93,7 +93,7 @@ remote_dns_health_check() {
     IFS=$'\n'
 
     # Starting health-check
-    for str in $(grep "SUSPENDED='no'" $VESTA/conf/dns-cluster.conf); do
+    for str in $(grep "SUSPENDED='no'" $HESTIA/conf/dns-cluster.conf); do
         eval $str
 
         # Checking host connection