From 0ed7efe93b912dffa73c431716298b9e249509b1 Mon Sep 17 00:00:00 2001 From: Roan Horning Date: Sun, 26 Feb 2023 17:49:45 -0500 Subject: [PATCH] Initial add of bash library for update utils Stubs for functions to be used in update scripts. --- utils/lib_utils.sh | 77 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 utils/lib_utils.sh diff --git a/utils/lib_utils.sh b/utils/lib_utils.sh new file mode 100644 index 0000000..d2c3468 --- /dev/null +++ b/utils/lib_utils.sh @@ -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 +# 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 . +# +#=============================================================================== + +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; } +