Files
backups/lib.sh
Vojtěch Káně 0ed9d3da47 Initial commit
2025-08-07 16:11:48 +02:00

27 lines
343 B
Bash

abort() {
echo "$1"
exit 1
}
info() {
if [ -z "$quiet" ]; then
echo "$1"
fi
}
verbose() {
if [ -n "$verbose" ]; then
echo "$1"
fi
}
checkPathComponent() {
local msg="Dangerous path component discovered: $1"
if [ "$1" = "." -o "$1" = ".." ]; then
abort "$msg"
fi
if echo "$1" | grep --quiet -F "/"; then
abort "$msg"
fi
}