dreport: Added core file plugin

Plugin used for moving dreport requestd core file
into the dreport packaging.

Change-Id: I927841ac82394b8736331169d91968feec11f4d5
Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
diff --git a/tools/dreport.d/plugins.d/corefile b/tools/dreport.d/plugins.d/corefile
new file mode 100644
index 0000000..14cd14b
--- /dev/null
+++ b/tools/dreport.d/plugins.d/corefile
@@ -0,0 +1,18 @@
+#!/bin/bash
+#
+# config: 1 1
+# @brief: Move user initialized core file to the dreport packaging.
+#
+
+. $DREPORT_INCLUDE/functions
+
+desc="Core file"
+if [ -z $optional_path ]; then
+    log_error "$desc does not exist"
+    exit
+fi
+
+# Remove the file from optional_path after successful copy
+if add_copy_file "$optional_path" "$desc"; then
+    rm "$optional_path"
+fi