Browse Source

IPV6: Remove needless files and functions to change sys ipv6

asmcc 3 years ago
parent
commit
92ec3c9a59
4 changed files with 0 additions and 167 deletions
  1. 0 48
      bin/v-change-sys-ipv6-name
  2. 0 48
      bin/v-change-sys-ipv6-owner
  3. 0 56
      bin/v-change-sys-ipv6-status
  4. 0 15
      func/ip.sh

+ 0 - 48
bin/v-change-sys-ipv6-name

@@ -1,48 +0,0 @@
-#!/bin/bash
-# info: change ip name
-# options: IPV6 NAME
-#
-# The function for changing the name of the ip.
-
-
-#----------------------------------------------------------#
-#                    Variable&Function                     #
-#----------------------------------------------------------#
-
-# Argument definition
-ipv6=$1
-ip_name=$2
-
-# Includes
-source $HESTIA/func/main.sh
-source $HESTIA/func/ip.sh
-source $HESTIA/conf/hestia.conf
-
-
-#----------------------------------------------------------#
-#                    Verifications                         #
-#----------------------------------------------------------#
-
-check_args '2' "$#" 'IPV6 IP_NAME'
-is_format_valid 'ipv6'
-is_format_valid 'ip_name'
-is_ipv6_valid "$ipv6"
-
-
-#----------------------------------------------------------#
-#                       Action                             #
-#----------------------------------------------------------#
-
-# Changing ip name
-update_ipv6_value '$NAME' "$ip_name"
-
-
-#----------------------------------------------------------#
-#                       Hestia                             #
-#----------------------------------------------------------#
-
-# Logging
-log_history "changed associated name of $ipv6 to $ip_name" '' 'admin'
-log_event "$OK" "$ARGUMENTS"
-
-exit

+ 0 - 48
bin/v-change-sys-ipv6-owner

@@ -1,48 +0,0 @@
-#!/bin/bash
-# info: change ip name
-# options: IPV6 NAME
-#
-# The function for changing the name of the ip.
-
-
-#----------------------------------------------------------#
-#                    Variable&Function                     #
-#----------------------------------------------------------#
-
-# Argument definition
-ipv6=$1
-ip_name=$2
-
-# Includes
-source $HESTIA/func/main.sh
-source $HESTIA/func/ip.sh
-source $HESTIA/conf/hestia.conf
-
-
-#----------------------------------------------------------#
-#                    Verifications                         #
-#----------------------------------------------------------#
-
-check_args '2' "$#" 'IPV6 IP_NAME'
-is_format_valid 'ipv6'
-is_format_valid 'ip_name'
-is_ipv6_valid "$ipv6"
-
-
-#----------------------------------------------------------#
-#                       Action                             #
-#----------------------------------------------------------#
-
-# Changing ip name
-update_ipv6_value '$NAME' "$ip_name"
-
-
-#----------------------------------------------------------#
-#                       Hestia                             #
-#----------------------------------------------------------#
-
-# Logging
-log_history "changed associated name of $ipv6 to $ip_name" '' 'admin'
-log_event "$OK" "$ARGUMENTS"
-
-exit

+ 0 - 56
bin/v-change-sys-ipv6-status

@@ -1,56 +0,0 @@
-#!/bin/bash
-# info: change ip status
-# options: IPV6 IP_STATUS
-#
-# The function of changing an ip address's status.
-
-
-#----------------------------------------------------------#
-#                    Variable&Function                     #
-#----------------------------------------------------------#
-
-# Argument definition
-ipv6=$1
-ip_status=$2
-
-# Includes
-source $HESTIA/func/main.sh
-source $HESTIA/func/ip.sh
-source $HESTIA/conf/hestia.conf
-
-
-#----------------------------------------------------------#
-#                    Verifications                         #
-#----------------------------------------------------------#
-
-check_args '2' "$#" 'IPV6 IP_STATUS'
-is_format_valid 'ipv6' 'ip_status'
-is_ipv6_valid "$ipv6"
-if [ "$ip_status" = "$(get_ipv6_value '$STATUS')" ]; then
-    check_result "$E_EXISTS" "status $ip_status is already set"
-fi
-web_domains=$(get_ipv6_value '$U_WEB_DOMAINS')
-sys_user=$(get_ipv6_value '$U_SYS_USERS')
-ip_owner=$(get_ipv6_value '$OWNER')
-if [ "$web_domains" -ne '0' ] && [ "$sys_user" != "$ip_owner" ]; then
-    check_result "$E_INUSE" "ip $ipv6 is used"
-fi
-
-
-#----------------------------------------------------------#
-#                       Action                             #
-#----------------------------------------------------------#
-
-# Changing ip name
-update_ipv6_value '$STATUS' "$ip_status"
-
-
-#----------------------------------------------------------#
-#                       Hestia                             #
-#----------------------------------------------------------#
-
-# Logging
-log_history "changed $ipv6 status to $ip_status" '' 'admin'
-log_event "$OK" "$ARGUMENTS"
-
-exit

+ 0 - 15
func/ip.sh

@@ -315,21 +315,6 @@ get_ipv6_iface() {
     echo "$interface:$n"
     echo "$interface:$n"
 }
 }
 
 
-# Update ipv6 address value
-update_ipv6_value() {
-    key="$1"
-    value="$2"
-    conf="$HESTIA/data/ips/$ipv6"
-    str=$(cat $conf)
-    eval $str
-    c_key=$(echo "${key//$/}")
-    eval old="${key}"
-    old=$(echo "$old" | sed -e 's/\\/\\\\/g' -e 's/&/\\&/g' -e 's/\//\\\//g')
-    new=$(echo "$value" | sed -e 's/\\/\\\\/g' -e 's/&/\\&/g' -e 's/\//\\\//g')
-    sed -i "$str_number s/$c_key='${old//\*/\\*}'/$c_key='${new//\*/\\*}'/g"\
-        $conf
-}
-
 # Get ipv6 name
 # Get ipv6 name
 get_ipv6_alias() {
 get_ipv6_alias() {
 	if [ -n "$local_ipv6" ]; then
 	if [ -n "$local_ipv6" ]; then