mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 10:37:42 -07:00
improved dns record validation
This commit is contained in:
parent
5e6ad34026
commit
c9f8c5a9bd
1 changed files with 16 additions and 0 deletions
16
func/main.sh
16
func/main.sh
|
@ -764,6 +764,22 @@ validate_format_common() {
|
|||
log_event "$E_INVALID" "$EVENT"
|
||||
exit $E_INVALID
|
||||
fi
|
||||
if [[ "$1" =~ @ ]] && [ ${#1} -gt 1 ] ; then
|
||||
echo "Error: @ can not be mixed"
|
||||
log_event "$E_INVALID" "$EVENT"
|
||||
exit $E_INVALID
|
||||
fi
|
||||
if [[ $1 =~ \* ]]; then
|
||||
if [[ ! $1 =~ \*$ ]]; then
|
||||
echo "Error: * can be used only at the end"
|
||||
log_event "$E_INVALID" "$EVENT"
|
||||
exit $E_INVALID
|
||||
fi
|
||||
if [ "$(echo $1 | grep -o '*'|wc -l)" -gt 1 ]; then
|
||||
log_event "$E_INVALID" "$EVENT"
|
||||
echo "Error: * can be used only once"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# DNS record value
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue