diff options
author | Eric Bélanger <snowmaniscool@gmail.com> | 2009-10-14 15:18:07 -0400 |
---|---|---|
committer | Aaron Griffin <aaronmgriffin@gmail.com> | 2009-10-26 13:56:16 -0700 |
commit | 3d45f943876853b3a745914c8a5a74ffc039f99b (patch) | |
tree | fd27d47281f9193ca99d3280463e821fe06bf517 /db-functions | |
parent | f0e417f2be331b937dd56bf970c59370a55b6301 (diff) |
Moved chk_license to db-functions file
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Diffstat (limited to 'db-functions')
-rw-r--r-- | db-functions | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/db-functions b/db-functions index f4f9ee9..6611a92 100644 --- a/db-functions +++ b/db-functions @@ -110,4 +110,20 @@ get_repos_for_host() { fi } +#usage: chk_license ${license[@]}" +chk_license() { + local l + for l in "$@"; do + l="$(echo $l | tr '[:upper:]' '[:lower:]')" + for allowed in ${ALLOWED_LICENSES[@]}; do + allowed="$(echo $allowed | tr '[:upper:]' '[:lower:]')" + if [ "$l" = "$allowed" ]; then + return 0 + fi + done + done + + return 1 +} + # vim: set ts=4 sw=4 noet ft=sh: |