diff options
-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 |