2018-02-01 06:09:32 +00:00
|
|
|
#!/usr/bin/env bash
|
2017-02-12 11:52:10 +00:00
|
|
|
#
|
|
|
|
# zammad restore script
|
|
|
|
#
|
|
|
|
|
|
|
|
PATH=/sbin:/bin:/usr/sbin:/usr/bin:
|
2017-05-07 10:20:59 +00:00
|
|
|
BACKUP_SCRIPT_PATH="$(dirname $(realpath $0))"
|
2017-02-12 11:52:10 +00:00
|
|
|
|
2017-05-07 10:20:59 +00:00
|
|
|
if [ -f "${BACKUP_SCRIPT_PATH}/config" ]; then
|
|
|
|
# import config
|
|
|
|
. ${BACKUP_SCRIPT_PATH}/config
|
|
|
|
else
|
|
|
|
echo -e "\n The 'config' file is missing!"
|
|
|
|
echo -e " Please copy ${BACKUP_SCRIPT_PATH}/config.dist to ${BACKUP_SCRIPT_PATH}/config before running $0!\n"
|
|
|
|
exit 1
|
|
|
|
fi
|
2017-02-12 11:52:10 +00:00
|
|
|
|
|
|
|
# import functions
|
2017-05-07 10:20:59 +00:00
|
|
|
. ${BACKUP_SCRIPT_PATH}/functions
|
2017-02-12 11:52:10 +00:00
|
|
|
|
|
|
|
# exec restore
|
2017-05-07 10:20:59 +00:00
|
|
|
start_restore_message
|
|
|
|
|
|
|
|
get_zammad_dir
|
|
|
|
|
2017-02-12 13:56:39 +00:00
|
|
|
restore_warning "${1}"
|
2017-02-12 11:52:10 +00:00
|
|
|
|
|
|
|
check_database_config_exists
|
|
|
|
|
|
|
|
get_restore_dates
|
|
|
|
|
2017-02-12 13:56:39 +00:00
|
|
|
choose_restore_date "${1}"
|
2017-02-12 11:52:10 +00:00
|
|
|
|
|
|
|
detect_initcmd
|
|
|
|
|
|
|
|
stop_zammad
|
|
|
|
|
|
|
|
restore_zammad
|
|
|
|
|
|
|
|
start_zammad
|
|
|
|
|
2017-05-07 10:20:59 +00:00
|
|
|
finished_restore_message
|