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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user