forked from hestiacp/hestiacp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpostinst
More file actions
87 lines (64 loc) · 2.6 KB
/
postinst
File metadata and controls
87 lines (64 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/bash
if [ ! -e "/usr/local/hestia/data/users/admin" ]; then
exit
fi
###############################################################
# Initialize functions/variables #
###############################################################
# Load upgrade functions and variables
source /usr/local/hestia/func/main.sh
source /usr/local/hestia/func/upgrade.sh
source /usr/local/hestia/conf/hestia.conf
source /usr/local/hestia/install/upgrade/upgrade.conf
###############################################################
# Set new version numbers for packages #
###############################################################
# Hestia Control Panel
new_version=$(dpkg -l | awk '$2=="hestia" { print $3 }')
###############################################################
# Begin standard upgrade routines #
###############################################################
# Set default verbose output based on release branch
is_debug_build
# Detect operating system version
detect_os
# Initialize backup directories
upgrade_init_backup
# Initialize logging
upgrade_init_logging
# Set up console display and welcome message
upgrade_welcome_message_log >> $LOG
upgrade_welcome_message
# Perform upgrade health check and refresh configuration before upgrading
upgrade_health_check | tee -a $LOG
upgrade_refresh_config
# Back up existing configuration files and templates
upgrade_start_backup | tee -a $LOG
# Execute version-specific upgrade scripts
upgrade_start_routine | tee -a $LOG
# Upgrade File Manager and update configuration
upgrade_filemanager | tee -a $LOG
upgrade_filemanager_update_config | tee -a $LOG
# Update Web domain templates
upgrade_rebuild_web_templates | tee -a $LOG
# Update Mail domain templates
upgrade_rebuild_mail_templates | tee -a $LOG
# Update DNS zone templates
upgrade_rebuild_dns_templates | tee -a $LOG
# Upgrade phpMyAdmin if applicable
upgrade_phpmyadmin | tee -a $LOG
# Set new version number in hestia.conf
upgrade_set_version $new_version
# Perform upgrade clean-up tasks (rebuild domains and users, restart services, delete temporary files)
upgrade_cleanup_message | tee -a $LOG
upgrade_rebuild_users | tee -a $LOG
upgrade_restart_services | tee -a $LOG
upgrade_perform_cleanup | tee -a $LOG
# Add upgrade notification to admin user's panel and display completion message
upgrade_complete_message_log >> $LOG
upgrade_complete_message
# If setting variables are set to true in hestia.conf, send notifications and email output.
upgrade_send_notification_to_panel
upgrade_send_notification_to_email
upgrade_send_log_to_email
exit 0