diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2015-08-24 22:04:24 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2015-08-24 22:04:24 -0300 |
commit | bc2d245da47f11b22440e3ff2c2a474120b30af1 (patch) | |
tree | aaad7817aa1f876508e3d8b49f9b4172d23254cb /share/hydractl | |
parent | c2ab91cbfd21509943883c6240f0b60fcf837819 (diff) | |
download | hydra-bc2d245da47f11b22440e3ff2c2a474120b30af1.tar.gz hydra-bc2d245da47f11b22440e3ff2c2a474120b30af1.tar.bz2 |
More upgrade procedures at system-upgrade
Diffstat (limited to 'share/hydractl')
-rwxr-xr-x | share/hydractl/system-upgrade | 78 |
1 files changed, 49 insertions, 29 deletions
diff --git a/share/hydractl/system-upgrade b/share/hydractl/system-upgrade index da42770..358920b 100755 --- a/share/hydractl/system-upgrade +++ b/share/hydractl/system-upgrade @@ -115,6 +115,51 @@ function hydra_system_upgrade_download { hydra_system_upgrade_stage upgrade } +# Proceed with the actual upgrade +function hydra_system_upgrade_upgrade { + echo "" + echo "Upgrading the system..." + DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade + + if [ "$?" != "0" ]; then + echo "Upgrade failed. Please fix it manually and run this command again." + exit 1 + fi + + hydra_system_upgrade_stage cleanup +} + +# Cleanup procedures +function hydra_system_upgrade_cleanup { + apt-get autoremove -y + apt-get clean + hydra_system_upgrade_stage custom +} + +# Custom upgrade procedures +function hydra_system_upgrade_custom { + if [ "$nextrelease" == "wheezy" ]; then + # Old suhosin config + rm -f /etc/php5/conf.d/suhosin.ini + + # This has to be manually installed again + if [ -f "/etc/php5/cli/conf.d/uploadprogress.ini" ]; then + pecl uninstall uploadprogress + pecl install uploadprogress + fi + fi + + hydractl trac-upgrade + hydra_system_upgrade_stage puppet +} + +# Enable puppet again +function hydra_system_upgrade_custom { + echo "" + echo "Starting puppet again..." + hydractl puppet-enable +} + # Initialize if [ ! -e "$STATE" ]; then hydra_system_upgrade_env @@ -141,47 +186,22 @@ fi # Upgrade the system if [ "$STAGE" == "upgrade" ]; then - echo "" - echo "Upgrading the system..." - DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade - - if [ "$?" != "0" ]; then - echo "Upgrade failed. Please fix it manually and run this command again." - exit 1 - fi - - hydra_system_upgrade_stage cleanup + hydra_system_upgrade_upgrade fi # Cleanup if [ "$STAGE" == "cleanup" ]; then - apt-get autoremove -y - apt-get clean - hydra_system_upgrade_stage custom + hydra_system_upgrade_cleanup fi # Custom procedures if [ "$STAGE" == "custom" ]; then - if [ "$nextrelease" == "wheezy" ]; then - # Old suhosin config - rm -f /etc/php5/conf.d/suhosin.ini - - # This has to be manually installed again - if [ -f "/etc/php5/cli/conf.d/uploadprogress.ini" ]; then - pecl uninstall uploadprogress - pecl install uploadprogress - fi - fi - - hydractl trac-upgrade - hydra_system_upgrade_stage puppet + hydra_system_upgrade_custom fi # Enable puppet again if [ "$STAGE" == "puppet" ]; then - echo "" - echo "Starting puppet again..." - hydractl puppet-enable + hydra_system_upgrade_puppet fi # Teardown |