Files
debmirrorman/source/functions.lib.sh

31 lines
626 B
Bash

## 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
}