diff --git a/mangle/bugs/generate_category_sql b/mangle/bugs/generate_category_sql new file mode 100644 index 0000000..5a0518d --- /dev/null +++ b/mangle/bugs/generate_category_sql @@ -0,0 +1,5 @@ +#!/bin/bash +NAME="${1}" +PROJECT_ID="${2}" + +printf "INSERT INTO mantis_category_table (project_id, user_id, name, status) VALUES('%s', '0', '%s', '0');\n" "${PROJECT_ID}" "${NAME}" diff --git a/mangle/bugs/generate_category_sql_list b/mangle/bugs/generate_category_sql_list new file mode 100644 index 0000000..2aa6dd8 --- /dev/null +++ b/mangle/bugs/generate_category_sql_list @@ -0,0 +1,12 @@ +#!/bin/bash +LIST="${1}" +PROJECT_ID="${2}" + +if [ ! -f "${LIST}" ]; then + echo "Not a file list" + exit 2 +fi + +while IFS= read -r line; do + printf "INSERT INTO mantis_category_table (project_id, user_id, name, status) VALUES('%s', '0', '%s', '0');\n" "${PROJECT_ID}" "${line}" +done < "${LIST}"