diff --git a/patches/utils/patch_header.sh b/patches/utils/patch_header.sh index d02f9f99d4b97001a83587f9f7f8e907def5aaa9..53a5d578eb5e1a5d80e34a5168a828a5c8a255cf 100644 --- a/patches/utils/patch_header.sh +++ b/patches/utils/patch_header.sh @@ -23,8 +23,8 @@ # #header for patch scripts -. ../../load_settings.sh -. ../../utils.sh +. ../../utils/load_settings.sh +. ../../utils/helpers.sh USAGE="$1 [ --env=ENV_FILE ] [ --patch=PATCH ] [ --backupdir=BACKUPDIR ]\n\n" CMD_OPTIONS=$(cat <<EOF diff --git a/utils/backup.sh b/utils/backup.sh index ff671437f42832c8c66ba250f777c4aa8d3f0c88..72c9c7eb0182a03d58165ad65da76aba8df62481 100755 --- a/utils/backup.sh +++ b/utils/backup.sh @@ -58,12 +58,11 @@ backup: EOF ) -# Config and command line parameter loading ################################### +# Load settings from .config and defaults ##################################### +. ../load_settings.sh -. ../.config - -# load useful stuff - parses the commandline parameters and so on... -. ../patches/utils/patch_header.sh +# load useful functions ####################################################### +. helpers.sh function backup() { NARG_NAME="$1" @@ -75,7 +74,7 @@ function backup() { failure "dumpfile already exists." fi echo "Dumping database $NARG_NAME to $NARG_FILE ... " - $CMD_MYSQL_DUMP $MYSQL_CONNECTION_NO_DB $* --opt --default-character-set=utf8 --routines \ + $MYSQLDUMP_CMD $MYSQL_CONNECTION_NO_DB $* --opt --default-character-set=utf8 --routines \ "$NARG_NAME" > "$NARG_FILE" if [[ "$YAML" == "true" ]] ; then diff --git a/utils.sh b/utils/helpers.sh similarity index 100% rename from utils.sh rename to utils/helpers.sh diff --git a/load_settings.sh b/utils/load_settings.sh similarity index 95% rename from load_settings.sh rename to utils/load_settings.sh index d26b2968265395f93a2408e59b7e4ee2b1cd33b4..461e3ee5894762d6ee8be3713264e97dd3001cb0 100644 --- a/load_settings.sh +++ b/utils/load_settings.sh @@ -18,8 +18,8 @@ # 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/>. -[[ -n "config.defaults" ]] && source "config.defaults" -[[ -n ".config" ]] && source ".config" +[[ -n "../config.defaults" ]] && source "../config.defaults" +[[ -n "../.config" ]] && source "../.config" [[ -n "$ENV_FILE" ]] && source "$ENV_FILE" if [[ -z "$DATABASE_NAME" && -z "$MYSQL_CONNECTION" ]]