1 Commits

Author SHA1 Message Date
6d2fd44dba - Start migration of dns, network & vpn lib,
- Start migration of rx3_net_adm.
2026-04-13 16:35:39 +02:00
15 changed files with 132 additions and 30 deletions

View File

@@ -1,11 +1,11 @@
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
Network Tools V 1.1.4 - A. GIBERT - 2026/04/13 Network Tools V 1.2.0 - A. GIBERT - 2026/04/xx
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
- Add rx3-network.minotaur config file, - Migrate Network Tools to the new Rx3 Base Bash library,
- Add missing etc/sudoers.d/rx3-network config file, - Add RPM Spec & bash completion files,
- Minor config files update, - Move install dir form /usr/locla to usr,
- Last release of the 1.1.x branch. - Support now rx3-base 1.1.1.

View File

@@ -1,28 +1,48 @@
#!/bin/bash #!/bin/bash
#-----------------------------------------------------------------------------------------------------------------------------------
#
# Rx3 DNS Library
#
# Copyright (C) 2025-2026 Arnaud G. GIBERT
# mailto:arnaud@rx3.net
#
# This is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; If not, see
# <https://www.gnu.org/licenses/>.
#
#-----------------------------------------------------------------------------------------------------------------------------------
if [[ "${DNS_BASH}" != "" ]] if [[ "${RX3_DNS_LIB}" != "" ]]
then then
return return
else else
declare -g DNS_BASH=1 declare -g RX3_DNS_LIB=1
fi fi
#-----------------------------------------------------------------------------------------------------------------------------------
# Includes # Includes
#----------------------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------------------------------------
if [[ -e /usr/local/lib/default.bash ]] : "${RX3_LIB_DIR:=/usr/lib/rx3}"
then . "${RX3_LIB_DIR}/base.bash"
. /usr/local/lib/default.bash
else
. /usr/global/lib/default.bash
fi
#-----------------------------------------------------------------------------------------------------------------------------------
# Global Variable # Global Variable
#----------------------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------------------------------------

View File

@@ -1,23 +1,48 @@
#!/bin/bash #!/bin/bash
#-----------------------------------------------------------------------------------------------------------------------------------
#
# Rx3 Network Library
#
# Copyright (C) 2025-2026 Arnaud G. GIBERT
# mailto:arnaud@rx3.net
#
# This is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; If not, see
# <https://www.gnu.org/licenses/>.
#
#-----------------------------------------------------------------------------------------------------------------------------------
if [[ "${NETWORK_BASH}" != "" ]] if [[ "${RX3_NETWORK_LIB}" != "" ]]
then then
return return
else else
declare -g NETWORK_BASH=1 declare -g RX3_NETWORK_LIB=1
fi fi
#-----------------------------------------------------------------------------------------------------------------------------------
# Includes # Includes
#----------------------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------------------------------------
. /usr/local/lib/dns.bash : "${RX3_LIB_DIR:=/usr/lib/rx3}"
. "${RX3_LIB_DIR}/dns.bash"
#-----------------------------------------------------------------------------------------------------------------------------------
# Global Variable # Global Variable
#----------------------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------------------------------------
@@ -119,7 +144,7 @@ num_to_ip()
# Optional safety check # Optional safety check
if (( num < 0 || num > 4294967295 )) if (( num < 0 || num > 4294967295 ))
then then
echo "num_to_ip: value out of range (04294967295)" >&2 echo_error "num_to_ip: value out of range (04294967295)"
return 1 return 1
fi fi
@@ -699,7 +724,7 @@ network_src_tab_load()
if [[ " ${NETWORK_TABLE_LIST} " != *" ${nstl_table} "* ]] if [[ " ${NETWORK_TABLE_LIST} " != *" ${nstl_table} "* ]]
then then
err_echo "Invalid table number: [${nstl_table}] in network src entry: [${nstl_id}]!" echo_error "Invalid table number: [${nstl_table}] in network src entry: [${nstl_id}]!"
exit 1 exit 1
fi fi
@@ -1094,13 +1119,13 @@ network_table_set()
if [[ "${src_id}" == "" ]] if [[ "${src_id}" == "" ]]
then then
err_echo "IP not found: [${nts_ip}]!" echo_error "IP not found: [${nts_ip}]!"
return 1 return 1
fi fi
if [[ " ${NETWORK_TABLE_LIST} " != *" ${nts_table} "* ]] if [[ " ${NETWORK_TABLE_LIST} " != *" ${nts_table} "* ]]
then then
err_echo "Table not found: [${nts_table}]!" echo_error "Table not found: [${nts_table}]!"
return 1 return 1
fi fi

View File

@@ -1,23 +1,48 @@
#!/bin/bash #!/bin/bash
#-----------------------------------------------------------------------------------------------------------------------------------
#
# Rx3 VPN Library
#
# Copyright (C) 2025-2026 Arnaud G. GIBERT
# mailto:arnaud@rx3.net
#
# This is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; If not, see
# <https://www.gnu.org/licenses/>.
#
#-----------------------------------------------------------------------------------------------------------------------------------
if [[ "${VPN_BASH}" != "" ]] if [[ "${RX3_VPN_LIB}" != "" ]]
then then
return return
else else
declare -g VPN_BASH=1 declare -g RX3_VPN_LIB=1
fi fi
#-----------------------------------------------------------------------------------------------------------------------------------
# Includes # Includes
#----------------------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------------------------------------
. /usr/local/lib/network.bash : "${RX3_LIB_DIR:=/usr/lib/rx3}"
. "${RX3_LIB_DIR}/network.bash"
#-----------------------------------------------------------------------------------------------------------------------------------
# Global Variable # Global Variable
#----------------------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------------------------------------

View File

@@ -1,4 +1,43 @@
#!/bin/bash #!/bin/bash
#-----------------------------------------------------------------------------------------------------------------------------------
#
# Rx3 Net Adm
#
# Copyright (C) 2025-2026 Arnaud G. GIBERT
# mailto:arnaud@rx3.net
#
# This is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; If not, see
# <https://www.gnu.org/licenses/>.
#
#-----------------------------------------------------------------------------------------------------------------------------------
#-----------------------------------------------------------------------------------------------------------------------------------
# Includes
#-----------------------------------------------------------------------------------------------------------------------------------
: "${RX3_LIB_DIR:=/usr/lib/rx3}"
. "${RX3_LIB_DIR}/network.bash"
#-----------------------------------------------------------------------------------------------------------------------------------
# Global Variable
#-----------------------------------------------------------------------------------------------------------------------------------
RETVAL=0 RETVAL=0
prog="rx3-net" prog="rx3-net"
@@ -12,13 +51,6 @@ prog="rx3-net"
# Includes
#-----------------------------------------------------------------------------------------------------------------------------------
. /usr/local/lib/network.bash
#-------------------------------------------------------------------------------------------------------------------------- #--------------------------------------------------------------------------------------------------------------------------