piwigo - fix unbound variable error and adapt to sequencer 16

This commit is contained in:
2022-07-01 10:47:48 +02:00
parent 75b27b2dd1
commit 37f861fa80

View File

@@ -4,22 +4,9 @@
## Installation and management of piwigo gallery ## Installation and management of piwigo gallery
toolName="piwigo" toolName="piwigo"
toolVersion="11.3.0"
# Get script working directory
# (when called from a different directory)
WDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >>/dev/null 2>&1 && pwd )"
CONFIG=0
SCRIPT_NAME=$(basename -- "$0")
SCRIPT_NAME=${SCRIPT_NAME%%.*}
CONFIG_FILE_NAME="${SCRIPT_NAME}.cfg"
CONFIG_FILE_TEMPLATE="$WDIR/${CONFIG_FILE_NAME}.example"
seq_config() { seq_config() {
initSeqConfig "$CONFIG_FILE_NAME" "$CONFIG_FILE_TEMPLATE" if ! initSeqConfig "${seq_configName}" "${seq_configTemplate}" ; then
if [ $? -eq 0 ] ; then
CONFIG=1
else
dry || return 1 dry || return 1
fi fi
} }
@@ -31,22 +18,24 @@ step_30() {
} }
step_31_info() { step_31_info() {
echoinfoArgs "[daily|monthly(default]" echoinfoArgs "[daily|monthly(default)]"
echo "Backup ${toolName} database" echo "Backup ${toolName} database"
} }
step_31_alias() { echo "backupdb"; } step_31_alias() { echo "backupdb"; }
step_31() { step_31() {
case "$2" in case "${2:-}" in
daily|Daily|DAILY) daily|Daily|DAILY)
silent || echo " [I] Daily backup..." info "Daily backup..."
exep "mysqldump --single-transaction -u root ${PIWI_DB_NAME} | bzip2 -c > \"${PIWI_BU_DIR}/${toolName}_daily.sql.bz2\"" exep mysqldump --single-transaction -u root "${PIWI_DB_NAME}" '|' bzip2 -c '>' "${PIWI_BU_DIR}/${toolName}_daily.sql.bz2"
;; ;;
*) *)
silent || echo " [I] Monthly backup..." info "Monthly backup..."
exep "mysqldump --single-transaction -u root ${PIWI_DB_NAME} | bzip2 -c > \"${PIWI_BU_DIR}/monthly/\`date +%Y%m%d\`_${toolName}.sql.bz2\"" exep mysqldump --single-transaction -u root "${PIWI_DB_NAME}" '|' bzip2 -c '>' "${PIWI_BU_DIR}/monthly/$(date +%Y%m%d)_${toolName}.sql.bz2"
;; ;;
esac esac
} }
# shellcheck disable=SC2034 # Appears unused
readonly sqr_minVersion=16 readonly sqr_minVersion=16
# shellcheck disable=SC1091 # Don't follow this source
. /usr/local/bin/sequencer.sh . /usr/local/bin/sequencer.sh