Initial commit

This commit is contained in:
Vojtěch Káně
2025-08-07 16:11:48 +02:00
commit 0ed9d3da47
4 changed files with 184 additions and 0 deletions

26
lib.sh Normal file
View File

@@ -0,0 +1,26 @@
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
}