|
4 | 4 | HESTIA="/usr/local/hestia" |
5 | 5 | HESTIA_BACKUP="/root/hst_upgrade/$(date +%d%m%Y%H%M)" |
6 | 6 | hestiacp="$HESTIA/install/deb" |
| 7 | +pma_v='4.9.0.1' |
7 | 8 |
|
8 | 9 | # Add webmail alias variable to system configuration if non-existent |
9 | 10 | WEBMAIL_ALIAS_CHECK=$(cat $HESTIA/conf/hestia.conf | grep WEBMAIL_ALIAS) |
@@ -181,7 +182,7 @@ if [ ! -e '/usr/bin/setfacl' ]; then |
181 | 182 | mv /var/lib/dpkg/updates/ /var/lib/dpkg/updates.bak/ |
182 | 183 | mkdir -p /var/lib/dpkg/updates/ |
183 | 184 |
|
184 | | - # Install missing acl package |
| 185 | + # Install missing acl package |
185 | 186 | apt-get -qq update > /dev/null 2>&1 |
186 | 187 | apt-get -qq -y install acl > /dev/null 2>&1 |
187 | 188 |
|
@@ -374,6 +375,38 @@ for user in `ls /usr/local/hestia/data/users/`; do |
374 | 375 | fi |
375 | 376 | done |
376 | 377 |
|
| 378 | +# Upgrade phpMyAdmin |
| 379 | +if [ "$DB_SYSTEM" = 'mysql' ]; then |
| 380 | + # Display upgrade information |
| 381 | + echo "(*) Upgrade phpMyAdmin to v$pma_v..." |
| 382 | + |
| 383 | + # Download latest phpMyAdmin release |
| 384 | + wget --quiet https://files.phpmyadmin.net/phpMyAdmin/$pma_v/phpMyAdmin-$pma_v-all-languages.tar.gz |
| 385 | + |
| 386 | + # Unpack files |
| 387 | + tar xzf phpMyAdmin-$pma_v-all-languages.tar.gz |
| 388 | + |
| 389 | + # Delete file to prevent error |
| 390 | + rm -fr /usr/share/phpmyadmin/doc/html |
| 391 | + |
| 392 | + # Overwrite old files |
| 393 | + cp -rf phpMyAdmin-$pma_v-all-languages/* /usr/share/phpmyadmin |
| 394 | + |
| 395 | + # Set config and log directory |
| 396 | + sed -i "s|define('CONFIG_DIR', '');|define('CONFIG_DIR', '/etc/phpmyadmin/');|" /usr/share/phpmyadmin/libraries/vendor_config.php |
| 397 | + sed -i "s|define('TEMP_DIR', './tmp/');|define('TEMP_DIR', '/var/lib/phpmyadmin/tmp/');|" /usr/share/phpmyadmin/libraries/vendor_config.php |
| 398 | + |
| 399 | + # Create temporary folder and change permissions |
| 400 | + if [ ! -d /usr/share/phpmyadmin/tmp ]; then |
| 401 | + mkdir /usr/share/phpmyadmin/tmp |
| 402 | + chmod 777 /usr/share/phpmyadmin/tmp |
| 403 | + fi |
| 404 | + |
| 405 | + # Clear up |
| 406 | + rm -fr phpMyAdmin-$pma_v-all-languages |
| 407 | + rm -f phpMyAdmin-$pma_v-all-languages.tar.gz |
| 408 | +fi |
| 409 | + |
377 | 410 | # Add upgrade notification to admin user's panel |
378 | 411 | $BIN/v-add-user-notification admin 'Upgrade complete' 'Your server has been updated to v0.10.0.<br>Please report any bugs on GitHub at<br>https://github.com/hestiacp/hestiacp/Issues<br><br>Have a great day!' |
379 | 412 |
|
|
0 commit comments