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,35 @@
#!/bin/bash
#
# An IP address looks like this:
# 192.168.0.5
# Four groups of 1-3 numbers in the range 0..255 separated by dots.
#
re='^([0-9]{1,3}\.){3}[0-9]{1,3}$'
#
# The address is expected as the only argument
#
if [[ $# -ne 1 ]]; then
echo "Usage: $0 IP_address"
exit 1
fi
#
# Validate against the regex
#
if [[ $1 =~ $re ]]; then
#
# Look at the components and check they are all in range
#
for d in ${1//./ }; do
if [[ $d -lt 0 || $d -gt 255 ]]; then
echo "$1 is not a valid IP address (contains $d)"
exit 1
fi
done
echo "$1 is a valid IP address"
else
echo "$1 is not a valid IP address"
fi