| 
															 | 
															 | 
															 | 
															 | 
															 | 
														
														
													
														
															 | 
															 | 
															# @creation_date: 2022-11-02 | 
															 | 
															 | 
															# @creation_date: 2022-11-02 | 
														
														
													
														
															 | 
															 | 
															# @license: The MIT License <https://opensource.org/licenses/MIT> | 
															 | 
															 | 
															# @license: The MIT License <https://opensource.org/licenses/MIT> | 
														
														
													
														
															 | 
															 | 
															# @author: Simon Bowie <ad7588@coventry.ac.uk> | 
															 | 
															 | 
															# @author: Simon Bowie <ad7588@coventry.ac.uk> | 
														
														
													
														
															 | 
															 | 
															# @purpose: Runs database functions for the ExPub Compendium | 
															 | 
															 | 
															 | 
														
														
													
														
															 | 
															 | 
															 | 
															 | 
															 | 
															# @purpose: Runs database functions for the Experimental Publishing Compendium | 
														
														
													
														
															 | 
															 | 
															# @acknowledgements: | 
															 | 
															 | 
															# @acknowledgements: | 
														
														
													
														
															 | 
															 | 
															# https://www.redhat.com/sysadmin/arguments-options-bash-scripts | 
															 | 
															 | 
															# https://www.redhat.com/sysadmin/arguments-options-bash-scripts | 
														
														
													
														
															 | 
															 | 
															
  | 
															 | 
															 | 
															
  | 
														
														
													
												
													
														
															 | 
															 | 
															 | 
															 | 
															 | 
															 | 
														
														
													
														
															 | 
															 | 
															Help() | 
															 | 
															 | 
															Help() | 
														
														
													
														
															 | 
															 | 
															{ | 
															 | 
															 | 
															{ | 
														
														
													
														
															 | 
															 | 
															   # Display Help | 
															 | 
															 | 
															   # Display Help | 
														
														
													
														
															 | 
															 | 
															   echo "This script performs database functions for the ExPub Compendium" | 
															 | 
															 | 
															 | 
														
														
													
														
															 | 
															 | 
															 | 
															 | 
															 | 
															   echo "This script performs database functions for the Experimental Publishing Compendium" | 
														
														
													
														
															 | 
															 | 
															   echo | 
															 | 
															 | 
															   echo | 
														
														
													
														
															 | 
															 | 
															   echo "Syntax: database_functions.sh [-l|h|e|i|c|v|d]" | 
															 | 
															 | 
															   echo "Syntax: database_functions.sh [-l|h|e|i|c|v|d]" | 
														
														
													
														
															 | 
															 | 
															   echo "options:" | 
															 | 
															 | 
															   echo "options:" | 
														
														
													
												
													
														
															 | 
															 | 
															 | 
															 | 
															 | 
															 | 
														
														
													
														
															 | 
															 | 
															
  | 
															 | 
															 | 
															
  | 
														
														
													
														
															 | 
															 | 
															# set variables | 
															 | 
															 | 
															# set variables | 
														
														
													
														
															 | 
															 | 
															CONTAINER=mariadb | 
															 | 
															 | 
															CONTAINER=mariadb | 
														
														
													
														
															 | 
															 | 
															DATABASE=toolkit | 
															 | 
															 | 
															 | 
														
														
													
														
															 | 
															 | 
															 | 
															 | 
															 | 
															DATABASE=compendium | 
														
														
													
														
															 | 
															 | 
															USERNAME=xxxxxxxx | 
															 | 
															 | 
															USERNAME=xxxxxxxx | 
														
														
													
														
															 | 
															 | 
															PASSWORD=xxxxxxxx | 
															 | 
															 | 
															PASSWORD=xxxxxxxx | 
														
														
													
														
															 | 
															 | 
															EXPORT_DIRECTORY="./db_exports" | 
															 | 
															 | 
															EXPORT_DIRECTORY="./db_exports" | 
														
														
													
														
															 | 
															 | 
															EXPORT_SQL_FILENAME=toolkit_db_ | 
															 | 
															 | 
															 | 
														
														
													
														
															 | 
															 | 
															 | 
															 | 
															 | 
															EXPORT_SQL_FILENAME=compendium_db_ | 
														
														
													
														
															 | 
															 | 
															EXPORT_TXT_FILENAME=$2`date +"%Y%m%d"` | 
															 | 
															 | 
															EXPORT_TXT_FILENAME=$2`date +"%Y%m%d"` | 
														
														
													
														
															 | 
															 | 
															
  | 
															 | 
															 | 
															
  | 
														
														
													
														
															 | 
															 | 
															# error message for no flags | 
															 | 
															 | 
															# error message for no flags |