Browse Source

Fix hardcoded vesta/hestia location.

Raphael Schneeberger 7 years ago
parent
commit
2709087c63

+ 5 - 5
bin/v-add-cron-letsencrypt-job

@@ -10,8 +10,8 @@
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 # Includes
 # Includes
-source $VESTA/func/main.sh
-source $VESTA/conf/vesta.conf
+source $HESTIA/func/main.sh
+source $HESTIA/conf/vesta.conf
 
 
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#
@@ -26,15 +26,15 @@ is_system_enabled "$CRON_SYSTEM" 'CRON_SYSTEM'
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 # Add cron job
 # Add cron job
-cmd="sudo /usr/local/vesta/bin/v-update-sys-queue letsencrypt"
-check_cron=$(grep "$cmd" $VESTA/data/users/admin/cron.conf 2> /dev/null)
+cmd="sudo $HESTIA/bin/v-update-sys-queue letsencrypt"
+check_cron=$(grep "$cmd" $HESTIA/data/users/admin/cron.conf 2> /dev/null)
 if [ -z "$check_cron" ] && [ ! -z "$CRON_SYSTEM" ]; then
 if [ -z "$check_cron" ] && [ ! -z "$CRON_SYSTEM" ]; then
     $BIN/v-add-cron-job admin '*/5' '*' '*' '*' '*' "$cmd"
     $BIN/v-add-cron-job admin '*/5' '*' '*' '*' '*' "$cmd"
 fi
 fi
 
 
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#
-#                       Vesta                              #
+#                       Hestia                             #
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 # Logging
 # Logging

+ 5 - 5
bin/v-add-cron-restart-job

@@ -10,8 +10,8 @@
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 # Includes
 # Includes
-source $VESTA/func/main.sh
-source $VESTA/conf/vesta.conf
+source $HESTIA/func/main.sh
+source $HESTIA/conf/hestia.conf
 
 
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#
@@ -26,15 +26,15 @@ is_system_enabled "$CRON_SYSTEM" 'CRON_SYSTEM'
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 # Add cron job
 # Add cron job
-cmd="sudo /usr/local/vesta/bin/v-update-sys-queue restart"
-check_cron=$(grep "$cmd" $VESTA/data/users/admin/cron.conf 2> /dev/null)
+cmd="sudo $HESTIA/bin/v-update-sys-queue restart"
+check_cron=$(grep "$cmd" $HESTIA/data/users/admin/cron.conf 2> /dev/null)
 if [ -z "$check_cron" ] && [ ! -z "$CRON_SYSTEM" ]; then
 if [ -z "$check_cron" ] && [ ! -z "$CRON_SYSTEM" ]; then
     $BIN/v-add-cron-job admin '*' '*' '*' '*' '*' "$cmd"
     $BIN/v-add-cron-job admin '*' '*' '*' '*' '*' "$cmd"
 fi
 fi
 
 
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#
-#                       Vesta                              #
+#                       Hestia                             #
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 # Logging
 # Logging

+ 9 - 9
bin/v-add-firewall-chain

@@ -21,15 +21,15 @@ protocol=$(echo $protocol|tr '[:lower:]' '[:upper:]')
 # Defining absolute path to iptables
 # Defining absolute path to iptables
 iptables="/sbin/iptables"
 iptables="/sbin/iptables"
 
 
-# Get vesta port by reading nginx.conf
-vestaport=$(grep 'listen' /usr/local/vesta/nginx/conf/nginx.conf | awk '{print $2}' | sed "s|;||")
-if [ -z "$vestaport" ]; then
-    vestaport=8083
+# Get hestia port by reading nginx.conf
+hestiaport=$(grep 'listen' $HESTIA/nginx/conf/nginx.conf | awk '{print $2}' | sed "s|;||")
+if [ -z "$hestiaport" ]; then
+    hestiaport=8083
 fi
 fi
 
 
 # Includes
 # Includes
-source $VESTA/func/main.sh
-source $VESTA/conf/vesta.conf
+source $HESTIA/func/main.sh
+source $HESTIA/conf/hestia.conf
 
 
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#
@@ -53,7 +53,7 @@ case $chain in
     DNS)        port=53; protocol=UDP  ;;
     DNS)        port=53; protocol=UDP  ;;
     WEB)        port='80,443'; protocol=TCP  ;;
     WEB)        port='80,443'; protocol=TCP  ;;
     DB)         port='3306,5432'; protocol=TCP  ;;
     DB)         port='3306,5432'; protocol=TCP  ;;
-    VESTA)      port=$vestaport; protocol=TCP  ;;
+    HESTIA)     port=$hestiaport; protocol=TCP  ;;
     *)          check_args '2' "$#" 'CHAIN PORT' ;;
     *)          check_args '2' "$#" 'CHAIN PORT' ;;
 esac
 esac
 
 
@@ -72,7 +72,7 @@ if [ $? -eq 0 ]; then
 fi
 fi
 
 
 # Preserving chain
 # Preserving chain
-chains=$VESTA/data/firewall/chains.conf
+chains=$HESTIA/data/firewall/chains.conf
 check_chain=$(grep "CHAIN='$chain'" $chains 2>/dev/null)
 check_chain=$(grep "CHAIN='$chain'" $chains 2>/dev/null)
 if [ -z "$check_chain" ]; then
 if [ -z "$check_chain" ]; then
     echo "CHAIN='$chain' PORT='$port' PROTOCOL='$protocol'" >> $chains
     echo "CHAIN='$chain' PORT='$port' PROTOCOL='$protocol'" >> $chains
@@ -83,7 +83,7 @@ chmod 660 $chains
 
 
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#
-#                       Vesta                              #
+#                       Hestia                             #
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 # Logging
 # Logging

+ 11 - 11
bin/v-add-remote-dns-host

@@ -24,9 +24,9 @@ dns_user=${6-dns-cluster}
 DNS_USER=$dns_user
 DNS_USER=$dns_user
 
 
 # Includes
 # Includes
-source $VESTA/func/main.sh
-source $VESTA/func/remote.sh
-source $VESTA/conf/vesta.conf
+source $HESTIA/func/main.sh
+source $HESTIA/func/remote.sh
+source $HESTIA/conf/hestia.conf
 
 
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#
@@ -57,14 +57,14 @@ str="$str DNS_USER='$dns_user' TYPE='$type' SUSPENDED='no'"
 str="$str TIME='$time' DATE='$date'"
 str="$str TIME='$time' DATE='$date'"
 
 
 # Adding host to dns-cluster.conf
 # Adding host to dns-cluster.conf
-echo "$str" >> $VESTA/conf/dns-cluster.conf
-chmod 660 $VESTA/conf/dns-cluster.conf
+echo "$str" >> $HESTIA/conf/dns-cluster.conf
+chmod 660 $HESTIA/conf/dns-cluster.conf
 
 
 # Enabling DNS_CLUSTER
 # Enabling DNS_CLUSTER
-if [ -z "$(grep DNS_CLUSTER $VESTA/conf/vesta.conf)" ]; then
-    sed -i "s/^STATS_/DNS_CLUSTER='yes'\nSTATS_/g" $VESTA/conf/vesta.conf
+if [ -z "$(grep DNS_CLUSTER $HESTIA/conf/hestia.conf)" ]; then
+    sed -i "s/^STATS_/DNS_CLUSTER='yes'\nSTATS_/g" $HESTIA/conf/hestia.conf
 else
 else
-    sed -i "s/DNS_CLUSTER=.*/DNS_CLUSTER='yes'/g" $VESTA/conf/vesta.conf
+    sed -i "s/DNS_CLUSTER=.*/DNS_CLUSTER='yes'/g" $HESTIA/conf/hestia.conf
 fi
 fi
 
 
 # Enabling remote dns-cluster queue
 # Enabling remote dns-cluster queue
@@ -77,12 +77,12 @@ check_result $? "$HOST sync failed" $E_CONNECT
 
 
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#
-#                       Vesta                              #
+#                       Hestia                             #
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 # Adding local  dns-cluster cron job
 # Adding local  dns-cluster cron job
-cmd="sudo /usr/local/vesta/bin/v-update-sys-queue dns-cluster"
-check_cron=$(grep "$cmd" $VESTA/data/users/admin/cron.conf 2> /dev/null)
+cmd="sudo $HESTIA/bin/v-update-sys-queue dns-cluster"
+check_cron=$(grep "$cmd" $HESTIA/data/users/admin/cron.conf 2> /dev/null)
 if [ -z "$check_cron" ] && [ ! -z "$CRON_SYSTEM" ]; then
 if [ -z "$check_cron" ] && [ ! -z "$CRON_SYSTEM" ]; then
     $BIN/v-add-cron-job admin '*/5' '*' '*' '*' '*' "$cmd"
     $BIN/v-add-cron-job admin '*/5' '*' '*' '*' '*' "$cmd"
 fi
 fi

+ 5 - 5
bin/v-delete-cron-restart-job

@@ -10,8 +10,8 @@
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 # Includes
 # Includes
-source $VESTA/func/main.sh
-source $VESTA/conf/vesta.conf
+source $HESTIA/func/main.sh
+source $HESTIA/conf/hestia.conf
 
 
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#
@@ -26,8 +26,8 @@ is_system_enabled "$CRON_SYSTEM" 'CRON_SYSTEM'
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 # Add cron job
 # Add cron job
-cmd="sudo /usr/local/vesta/bin/v-update-sys-queue restart"
-check_cron=$(grep "$cmd" $VESTA/data/users/admin/cron.conf 2> /dev/null)
+cmd="sudo $HESTIA/bin/v-update-sys-queue restart"
+check_cron=$(grep "$cmd" $HESTIA/data/users/admin/cron.conf 2> /dev/null)
 if [ ! -z "$check_cron" ]; then
 if [ ! -z "$check_cron" ]; then
     eval $check_cron
     eval $check_cron
     $BIN/v-delete-cron-job admin "$JOB"
     $BIN/v-delete-cron-job admin "$JOB"
@@ -35,7 +35,7 @@ fi
 
 
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#
-#                       Vesta                              #
+#                       Hestia                             #
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 # Logging
 # Logging

+ 10 - 10
bin/v-delete-remote-dns-host

@@ -13,9 +13,9 @@
 host=$1
 host=$1
 
 
 # Includes
 # Includes
-source $VESTA/func/main.sh
-source $VESTA/func/remote.sh
-source $VESTA/conf/vesta.conf
+source $HESTIA/func/main.sh
+source $HESTIA/func/remote.sh
+source $HESTIA/conf/hestia.conf
 
 
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#
@@ -36,17 +36,17 @@ is_object_valid "../../conf/dns-cluster" 'HOST' "$host"
 $BIN/v-delete-remote-dns-domains $host >>/dev/null 2>&1
 $BIN/v-delete-remote-dns-domains $host >>/dev/null 2>&1
 
 
 # Deleting server
 # Deleting server
-sed -i "/HOST='$host' /d" $VESTA/conf/dns-cluster.conf
+sed -i "/HOST='$host' /d" $HESTIA/conf/dns-cluster.conf
 
 
 # Deleting DNS_CLUSTER key
 # Deleting DNS_CLUSTER key
-check_cluster=$(grep HOST $VESTA/conf/dns-cluster.conf |wc -l)
+check_cluster=$(grep HOST $HESTIA/conf/dns-cluster.conf |wc -l)
 if [ "$check_cluster" -eq '0' ]; then
 if [ "$check_cluster" -eq '0' ]; then
-    rm -f $VESTA/conf/dns-cluster.conf
-    sed -i "/DNS_CLUSTER=/d" $VESTA/conf/vesta.conf
+    rm -f $HESTIA/conf/dns-cluster.conf
+    sed -i "/DNS_CLUSTER=/d" $HESTIA/conf/vesta.conf
 
 
     # Delete cron job
     # Delete cron job
-    cmd="sudo /usr/local/vesta/bin/v-update-sys-queue dns-cluster"
-    check_cron=$(grep "$cmd" $VESTA/data/users/admin/cron.conf 2> /dev/null)
+    cmd="sudo $HESTIA/bin/v-update-sys-queue dns-cluster"
+    check_cron=$(grep "$cmd" $HESTIA/data/users/admin/cron.conf 2> /dev/null)
     if [ ! -z "$check_cron" ]; then
     if [ ! -z "$check_cron" ]; then
         eval $check_cron
         eval $check_cron
         $BIN/v-delete-cron-job admin "$JOB"
         $BIN/v-delete-cron-job admin "$JOB"
@@ -55,7 +55,7 @@ fi
 
 
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#
-#                       Vesta                              #
+#                       Hestia                             #
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 # Logging
 # Logging

+ 3 - 3
bin/v-generate-api-key

@@ -2,7 +2,7 @@
 # info: generate api key
 # info: generate api key
 # options: none
 # options: none
 #
 #
-# The function creates a key file in /usr/local/vesta/data/keys/
+# The function creates a key file in $HESTIA/data/keys/
 
 
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#
@@ -13,7 +13,7 @@ keygen()
 {
 {
     < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32};echo;
     < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32};echo;
 }
 }
-KEYS='/usr/local/vesta/data/keys/'
+KEYS='$HESTIA/data/keys/'
 HASH=$(keygen)
 HASH=$(keygen)
 
 
 
 
@@ -35,7 +35,7 @@ touch ${KEYS}${HASH}
 echo ${HASH}
 echo ${HASH}
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#
-#                       Vesta                              #
+#                       Hestia                             #
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 exit
 exit

+ 1 - 1
bin/v-generate-password-hash

@@ -1,4 +1,4 @@
-#!/usr/local/vesta/php/bin/php
+#!$HESTIA/php/bin/php
 <?php
 <?php
 //# info: generate password  hash
 //# info: generate password  hash
 //# options: HASH-METHOD SALT PASSWORD
 //# options: HASH-METHOD SALT PASSWORD

+ 11 - 11
bin/v-restart-proxy

@@ -10,12 +10,12 @@
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 # Includes
 # Includes
-source $VESTA/func/main.sh
-source $VESTA/conf/vesta.conf
+source $HESTIA/func/main.sh
+source $HESTIA/conf/hestia.conf
 PATH="$PATH:/usr/local/sbin:/sbin:/usr/sbin:/root/bin"
 PATH="$PATH:/usr/local/sbin:/sbin:/usr/sbin:/root/bin"
 
 
 send_email_report() {
 send_email_report() {
-    email=$(grep CONTACT $VESTA/data/users/admin/user.conf)
+    email=$(grep CONTACT $HESTIA/data/users/admin/user.conf)
     email=$(echo "$email" | cut -f 2 -d "'")
     email=$(echo "$email" | cut -f 2 -d "'")
     tmpfile=$(mktemp)
     tmpfile=$(mktemp)
     subj="$(hostname): $PROXY_SYSTEM restart failed"
     subj="$(hostname): $PROXY_SYSTEM restart failed"
@@ -37,11 +37,11 @@ fi
 
 
 # Schedule restart
 # Schedule restart
 if [ "$1" = 'scheduled' ]; then
 if [ "$1" = 'scheduled' ]; then
-    echo "$BIN/$SCRIPT now" >> $VESTA/data/queue/restart.pipe
+    echo "$BIN/$SCRIPT now" >> $HESTIA/data/queue/restart.pipe
     exit
     exit
 fi
 fi
 if [ -z "$1" ] && [ "$SCHEDULED_RESTART" = 'yes' ]; then
 if [ -z "$1" ] && [ "$SCHEDULED_RESTART" = 'yes' ]; then
-    echo "$BIN/$SCRIPT now" >> $VESTA/data/queue/restart.pipe
+    echo "$BIN/$SCRIPT now" >> $HESTIA/data/queue/restart.pipe
     exit
     exit
 fi
 fi
 
 
@@ -49,7 +49,7 @@ if [ -z "$PROXY_SYSTEM" ] || [ "$PROXY_SYSTEM" = 'remote' ]; then
     exit
     exit
 fi
 fi
 
 
-if [ -f "/usr/local/vesta/web/inc/nginx_proxy" ]; then
+if [ -f "$HESTIA/web/inc/nginx_proxy" ]; then
 
 
   # if vesta is behind default nginx, restart in background with 15 sec delay
   # if vesta is behind default nginx, restart in background with 15 sec delay
   # background restart
   # background restart
@@ -63,8 +63,8 @@ if [ -f "/usr/local/vesta/web/inc/nginx_proxy" ]; then
       fi
       fi
 
 
       # Update restart queue
       # Update restart queue
-      if [ -e "$VESTA/data/queue/restart.pipe" ]; then
-          sed -i "/$SCRIPT/d" $VESTA/data/queue/restart.pipe
+      if [ -e "$HESTIA/data/queue/restart.pipe" ]; then
+          sed -i "/$SCRIPT/d" $HESTIA/data/queue/restart.pipe
       fi
       fi
 
 
       exit;
       exit;
@@ -87,14 +87,14 @@ else
   fi
   fi
 
 
   # Update restart queue
   # Update restart queue
-  if [ -e "$VESTA/data/queue/restart.pipe" ]; then
-      sed -i "/$SCRIPT/d" $VESTA/data/queue/restart.pipe
+  if [ -e "$HESTIA/data/queue/restart.pipe" ]; then
+      sed -i "/$SCRIPT/d" $HESTIA/data/queue/restart.pipe
   fi
   fi
 
 
 fi
 fi
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#
-#                       Vesta                              #
+#                       Hestia                             #
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 exit
 exit