- Add VSL support,
- Display VSL tab in VPN Admin Board, - Support now rx3-base 1.2.0.
This commit is contained in:
@@ -39,27 +39,27 @@
|
||||
# Global Variables
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
declare -g VERSION="1.0.0"
|
||||
declare -g NAME="ip_host_update"
|
||||
declare -g HELP="usage: [-h | --help] | [-V | --version] | [-v | --verbose] <host> <zone> <ip> <ttl>"
|
||||
declare -g VERSION="1.2.4"
|
||||
declare -g NAME="ip_host_update"
|
||||
declare -g HELP="usage: [-h | --help] | [-V | --version] | [-v | --verbose] <host> <zone> <ip> <ttl>"
|
||||
|
||||
declare -g MODE="DEFAULT"
|
||||
declare -g VERBOSE="FALSE"
|
||||
declare -g DRY_RUN="FALSE"
|
||||
declare -g RETVAL=0
|
||||
declare -g EXIT_CODE=0
|
||||
declare -g MODE="DEFAULT"
|
||||
declare -g VERBOSE="FALSE"
|
||||
declare -g DRY_RUN="FALSE"
|
||||
|
||||
declare -g DEBUG=""
|
||||
#declare -g DEBUG="echo"
|
||||
#declare -g DEBUG=":"
|
||||
declare -g DEBUG=""
|
||||
#declare -g DEBUG="echo"
|
||||
#declare -g DEBUG=":"
|
||||
|
||||
declare -g LOG=""
|
||||
#declare -g LOG=":"
|
||||
#declare -g LOG="echo"
|
||||
declare -g LOG=""
|
||||
#declare -g LOG=":"
|
||||
#declare -g LOG="echo"
|
||||
|
||||
declare -g HOST=""
|
||||
declare -g ZONE=""
|
||||
declare -g IP=""
|
||||
declare -g TTL=""
|
||||
declare -g HOST=""
|
||||
declare -g ZONE=""
|
||||
declare -g IP=""
|
||||
declare -g TTL=""
|
||||
|
||||
|
||||
|
||||
@@ -84,7 +84,6 @@ ihu_version_print()
|
||||
|
||||
ihu_help_print()
|
||||
{
|
||||
ihu_version_print
|
||||
help_print
|
||||
}
|
||||
|
||||
@@ -107,25 +106,26 @@ ihu_args_parse()
|
||||
while true
|
||||
do
|
||||
case "$1" in
|
||||
# Options
|
||||
-h|--help) MODE="EXIT"; ihu_help_print; shift;;
|
||||
-V|--version) MODE="EXIT"; ihu_version_print; shift;;
|
||||
-v|--verbose) VERBOSE="TRUE"; shift;;
|
||||
# Mode switches
|
||||
-h|--help) MODE="HELP"; shift;;
|
||||
-V|--version) MODE="VERSION"; shift;;
|
||||
|
||||
# Global options
|
||||
-v|--verbose) VERBOSE="TRUE"; shift;;
|
||||
|
||||
# End of options
|
||||
--) shift; break;;
|
||||
*) echo "args_parse internal error [$1]!"; exit 1;;
|
||||
--) shift; break;;
|
||||
*) echo "args_parse internal error [$1]!"; exit 1;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ "${MODE}" != "EXIT" ]]
|
||||
if [[ "${MODE}" == "DEFAULT" ]]
|
||||
then
|
||||
if [[ "${#}" -lt "4" ]]
|
||||
then
|
||||
MODE="EXIT"
|
||||
|
||||
echo_error "Not enough args!"
|
||||
ihu_help_print
|
||||
MODE="HELP"
|
||||
EXIT_CODE=1
|
||||
else
|
||||
MODE="UPDATE"
|
||||
HOST="$1"
|
||||
@@ -162,12 +162,27 @@ ihu_host_update()
|
||||
# Main
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
vsl_add
|
||||
|
||||
ihu_args_parse "$@"
|
||||
|
||||
if [[ "${MODE}" == "EXIT" ]]
|
||||
then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
case "${MODE}" in
|
||||
"EXIT")
|
||||
exit ${EXIT_CODE}
|
||||
;;
|
||||
|
||||
"HELP")
|
||||
ihu_help_print
|
||||
exit ${EXIT_CODE}
|
||||
;;
|
||||
|
||||
"VERSION")
|
||||
ihu_version_print
|
||||
exit ${EXIT_CODE}
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
case "${MODE}" in
|
||||
UPDATE)
|
||||
@@ -176,8 +191,8 @@ case "${MODE}" in
|
||||
|
||||
*)
|
||||
echo "Usage: $0 <host> <zone> <ip> <ttl>"
|
||||
RETVAL=1
|
||||
EXIT_CODE=1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit ${RETVAL}
|
||||
exit ${EXIT_CODE}
|
||||
|
||||
Reference in New Issue
Block a user