|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# Hestia Control Panel upgrade script for target version 1.8.8 |
| 4 | + |
| 5 | +####################################################################################### |
| 6 | +####### Place additional commands below. ####### |
| 7 | +####################################################################################### |
| 8 | +####### upgrade_config_set_value only accepts true or false. ####### |
| 9 | +####### ####### |
| 10 | +####### Pass through information to the end user in case of a issue or problem ####### |
| 11 | +####### ####### |
| 12 | +####### Use add_upgrade_message "My message here" to include a message ####### |
| 13 | +####### in the upgrade notification email. Example: ####### |
| 14 | +####### ####### |
| 15 | +####### add_upgrade_message "My message here" ####### |
| 16 | +####### ####### |
| 17 | +####### You can use \n within the string to create new lines. ####### |
| 18 | +####################################################################################### |
| 19 | + |
| 20 | +upgrade_config_set_value 'UPGRADE_UPDATE_WEB_TEMPLATES' 'false' |
| 21 | +upgrade_config_set_value 'UPGRADE_UPDATE_DNS_TEMPLATES' 'false' |
| 22 | +upgrade_config_set_value 'UPGRADE_UPDATE_MAIL_TEMPLATES' 'false' |
| 23 | +upgrade_config_set_value 'UPGRADE_REBUILD_USERS' 'false' |
| 24 | +upgrade_config_set_value 'UPGRADE_UPDATE_FILEMANAGER_CONFIG' 'false' |
| 25 | + |
| 26 | +# Modify existing POLICY_USER directives (POLICY_USER_CHANGE_THEME, POLICY_USER_EDIT_WEB_TEMPLATES |
| 27 | +# and POLICY_USER_VIEW_LOGS) that are using value 'true' instead of the correct value 'yes' |
| 28 | + |
| 29 | +hestia_conf="$HESTIA/conf/hestia.conf" |
| 30 | +hestia_defaults_conf="$HESTIA/conf/defaults/hestia.conf" |
| 31 | + |
| 32 | +for i in POLICY_USER_CHANGE_THEME POLICY_USER_EDIT_WEB_TEMPLATES POLICY_USER_VIEW_LOGS; do |
| 33 | + if [[ -f "$hestia_conf" ]]; then |
| 34 | + if grep "$i" "$hestia_conf" | grep -q 'true'; then |
| 35 | + if "$BIN/v-change-sys-config-value" "$i" 'yes'; then |
| 36 | + echo "[ * ] Success: ${i} value changed from true to yes in hestia.conf" |
| 37 | + else |
| 38 | + echo "[ ! ] Error: Couldn't change ${i} value from true to yes in hestia.conf" |
| 39 | + fi |
| 40 | + fi |
| 41 | + fi |
| 42 | + if [[ -f "$hestia_defaults_conf" ]]; then |
| 43 | + if grep "$i" "$hestia_defaults_conf" | grep -q 'true'; then |
| 44 | + if sed -i "s/${i}='true'/${i}='yes'/" "$hestia_defaults_conf"; then |
| 45 | + echo "[ * ] Success: ${i} value changed from true to yes in defaults/hestia.conf" |
| 46 | + else |
| 47 | + echo "[ ! ] Error: Couldn't change ${i} value from true to yes in defaults/hestia.conf" |
| 48 | + fi |
| 49 | + fi |
| 50 | + fi |
| 51 | +done |
0 commit comments