Built and tested basic structure of the source of debmirrorman, added build.sh for building the source into a single executable file from the individual .sh and .lib.sh files.

This commit is contained in:
2026-03-29 04:29:18 +02:00
parent 3f4eb7e938
commit 1c648f2739
9 changed files with 364 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
## DebMirror Manager Functions Library
function funcCheckLocalRepo {
if [[ -z "${1}" ]]; then
return 5
else
localrepo="${1}"
fi
if [[ "${localrepo}" =~ ^[a-z0-9]+([a-z0-9-]*[a-z0-9])?$ ]]; then
if [[ -f "/etc/debmirrorman/settings.conf" ]]; then
source "/etc/debmirrorman/settings.conf"
if echo ${localrepos[@]} | tr ' ' '\n' | grep -q ^${localrepo}$; then
if [[ -f "/etc/debmirrorman/${localrepo}.repo" ]]; then
return 0
else
return 3
fi
else
return 2
fi
else
return 4
fi
else
return 1
fi
return 127
}