|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# Hestia Control Panel upgrade script for target version 1.6.2 |
| 4 | + |
| 5 | +####################################################################################### |
| 6 | +####### Place additional commands below. ####### |
| 7 | +####################################################################################### |
| 8 | +####### Pass through information to the end user in case of a issue or problem ####### |
| 9 | +####### ####### |
| 10 | +####### Use add_upgrade_message "My message here" to include a message ####### |
| 11 | +####### in the upgrade notification email. Example: ####### |
| 12 | +####### ####### |
| 13 | +####### add_upgrade_message "My message here" ####### |
| 14 | +####### ####### |
| 15 | +####### You can use \n within the string to create new lines. ####### |
| 16 | +####################################################################################### |
| 17 | + |
| 18 | +upgrade_config_set_value 'UPGRADE_UPDATE_WEB_TEMPLATES' 'no' |
| 19 | +upgrade_config_set_value 'UPGRADE_UPDATE_DNS_TEMPLATES' 'no' |
| 20 | +upgrade_config_set_value 'UPGRADE_UPDATE_MAIL_TEMPLATES' 'no' |
| 21 | +upgrade_config_set_value 'UPGRADE_REBUILD_USERS' 'no' |
| 22 | +upgrade_config_set_value 'UPGRADE_UPDATE_FILEMANAGER_CONFIG' 'false' |
| 23 | + |
| 24 | +alc=$(cat /etc/exim4/exim4.conf.template | grep '${lookup{${domain:$authenticated_id}}dsearch{/etc/exim4/domains/}}/limits'); |
| 25 | +if [ -z "$alc" ]; then |
| 26 | + sed -i 's| set acl_c_msg_limit|#string1\n#replaceme|' /etc/exim4/exim4.conf.template |
| 27 | + sed -i '/#replaceme/d' /etc/exim4/exim4.conf.template |
| 28 | + sed -i 's|#string1|set acl_c_msg_limit = \${if exists{/etc/exim4/domains/\${lookup{\${domain:\$authenticated_id}}dsearch{/etc/exim4/domains/}}/limits}{\${lookup {\$authenticated_id} lsearch{/etc/exim4/domains/\${lookup{${domain:\$authenticated_id}}dsearch{/etc/exim4/domains/}}/limits}{\$value}{\${readfile{/etc/exim4/limit.conf}}}}}{\${readfile{/etc/exim4/limit.conf}}} }|g' /etc/exim4/exim4.conf.template |
| 29 | +fi |
| 30 | + |
| 31 | +system_filter=$(cat /etc/exim4/exim4.conf.template | grep 'system_filter'); |
| 32 | +if [ -z "$system_filter" ]; then |
| 33 | + sed -i '/SMTP_RELAY_PASS = \${lookup{pass}lsearch{SMTP_RELAY_FILE}}/a #shouldberemoved\n# Custom Filter\nsystem_filter = \/etc\/exim4\/system.filter\nsystem_filter_user = Debian-exim' /etc/exim4/exim4.conf.template |
| 34 | + # Keep the spacing between the reley_pass and Custom Filter we need to insert a dummy text and remove it later on |
| 35 | + sed -i 's/#shouldberemoved//g' /etc/exim4/exim4.conf.template |
| 36 | +fi |
0 commit comments