move check for database.yml to functions file
This commit is contained in:
parent
3fe07dd28d
commit
d4a47cd3dc
2 changed files with 10 additions and 7 deletions
|
@ -48,3 +48,11 @@ function backup_db () {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function check_database_config_exists () {
|
||||||
|
if [ -f ${ZAMMAD_DIR}/${DATABASE_CONFIG} ]; then
|
||||||
|
get_db_credentials
|
||||||
|
else
|
||||||
|
echo "${ZAMMAD_DIR}/${DATABASE_CONFIG} is missing. is zammad configured yet?"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
|
@ -11,15 +11,10 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin:
|
||||||
# import functions
|
# import functions
|
||||||
. functions
|
. functions
|
||||||
|
|
||||||
|
# exec backup
|
||||||
delete_old_backups
|
delete_old_backups
|
||||||
|
|
||||||
# check if database.yml exists
|
check_database_config_exists
|
||||||
if [ -f ${ZAMMAD_DIR}/${DATABASE_CONFIG} ]; then
|
|
||||||
get_db_credentials
|
|
||||||
else
|
|
||||||
echo "${ZAMMAD_DIR}/${DATABASE_CONFIG} is missing. is zammad configured yet?"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
get_backup_date
|
get_backup_date
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue