Move under www to ease rsync

This commit is contained in:
2025-10-29 10:51:15 +01:00
parent 2bb22c7583
commit 30ad62e938
890 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
#=== FUNCTION ================================================================
# NAME: check_value
# DESCRIPTION: Checks a value against a list of regular expressions
# PARAMETERS: 1 - the value to be checked
# 2..n - valid Bash regular expressions
# RETURNS: 0 if the value checks, otherwise 1
#===============================================================================
check_value () {
local value="${1?Usage: check_value value list_of_regex}"
local matches=0
#
# Drop parameter 1 then there should be more
#
shift
if [[ $# == 0 ]]; then
echo "Usage: check_value value list_of_regex"
return 1
fi
#
# Loop through the regex args checking the value, counting matches
#
while [[ $# -ge 1 ]]
do
if [[ $value =~ $1 ]]; then
(( matches++ ))
fi
shift
done
#
# No matches, then the value is bad
#
if [[ $matches == 0 ]]; then
return 1
else
return 0
fi
}