Initial add of bash library for update utils

Stubs for functions to be used in update scripts.
This commit is contained in:
Roan Horning 2023-02-26 17:49:45 -05:00
parent b4e4187902
commit 0ed7efe93b
Signed by: rho_n
GPG Key ID: 234AEF20B72D5769

77
utils/lib_utils.sh Normal file
View File

@ -0,0 +1,77 @@
#!/bin/bash -
#===============================================================================
#
# FILE: lib_utils.sh
#
# USAGE: ./lib_utils.sh
#
# DESCRIPTION: functions for scripts used to update local HPR installations
# using the HPR static site generator
#
# OPTIONS: ---
# REQUIREMENTS: mysql2sqlite (https://github.com/dumblob/mysql2sqlite)
# BUGS: ---
# NOTES: ---
# AUTHOR: Roan "Rho`n" Horning <roan.horning@gmail.com>
# CREATED: 02/26/2023 03:27:08 PM -5 UTC
# REVISION: ---
# LICENSE: GNU AGPLv3
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
#===============================================================================
set -o nounset # Treat unset variables as an error
#--- FUNCTION ----------------------------------------------------------------
# NAME: make_working_dir
# DESCRIPTION: Creates a local temporary working directory
# SEE: https://stackoverflow.com/questions/4632028/how-to-create-a-temporary-directory#answer-34676160
# PARAMETERS:
# RETURNS: The path to the working directory
#-------------------------------------------------------------------------------
function make_working_dir { echo; }
#--- FUNCTION ----------------------------------------------------------------
# NAME: clean_working_dir
# DESCRIPTION: Remove local temporary working directory
# PARAMETERS:
# RETURNS:
#-------------------------------------------------------------------------------
function clean_working_dir { echo; }
#--- FUNCTION ----------------------------------------------------------------
# NAME: download_hpr_sql
# DESCRIPTION: Download the HPR SQL dump file into a working directory
# PARAMETERS:
# RETURNS:
#-------------------------------------------------------------------------------
function download_hpr_sql { echo; }
#--- FUNCTION ----------------------------------------------------------------
# NAME: make_hpr_sqlite_db
# DESCRIPTION: Converts the hpr sql file into an sqlite db file
# PARAMETERS:
# RETURNS:
#-------------------------------------------------------------------------------
function make_hpr_sqlite_db { echo; }
#--- FUNCTION ----------------------------------------------------------------
# NAME: copy_to_public_dir
# DESCRIPTION: Move HPR sql and db files to public website folder
# PARAMETERS:
# RETURNS:
#-------------------------------------------------------------------------------
function copy_to_public_dir { echo; }