$settings = array_keys($newSettings);
            foreach ($settings as $section) {
                if (isset($oldSettings[$section])) {
                    if (is_array($oldSettings[$section])) {
                        $sectionKeys = array_keys($newSettings[$section]);
                        foreach ($sectionKeys as $sectionKey) {
                            if (isset($oldSettings[$section][$sectionKey])) {
                                UpdateIniValue($conf, $sectionKey, $oldSettings[$section][$sectionKey]);
                            }
                        }
                    } else {
                        UpdateIniValue($conf, $section, $oldSettings[$section]);
                    }
                }
            }
        }
    }
}
// Backup the config files
$suffix = date("Ymdhis") . "-1.8.1";
foreach ($configFiles as $conf) {
    if (file_exists($conf)) {
        echo "Backing up {$conf} to {$conf}{$suffix}.bak" . PHP_EOL;
        exec("cp {$conf} {$conf}{$suffix}.bak");
    }
}
$default_suffix = "181";
CreateIniFiles($default_suffix);
echo "* Initializing INI files" . PHP_EOL;
MergeConfigFiles($configFiles, $suffix);
$CC_CONFIG = LoadConfig($CC_CONFIG);
    if (!file_exists("/etc/airtime/")) {
        if (!mkdir("/etc/airtime/", 0755, true)) {
            echo "Could not create /etc/airtime/ directory. Exiting.";
            exit(1);
        }
    }
    if (!copy("airtime.conf.170", CONF_FILE_AIRTIME)) {
        echo "Could not copy airtime.conf to /etc/airtime/. Exiting.";
        exit(1);
    }
    if (!copy($AIRTIME_PYTHON_APPS . "/pypo/pypo.cfg", CONF_FILE_PYPO)) {
        echo "Could not copy pypo.cfg to /etc/airtime/. Exiting.";
        exit(1);
    }
    if (!copy($AIRTIME_PYTHON_APPS . "/show-recorder/recorder.cfg", CONF_FILE_RECORDER)) {
        echo "Could not copy recorder.cfg to /etc/airtime/. Exiting.";
        exit(1);
    }
    if (!copy($AIRTIME_PYTHON_APPS . "/pypo/liquidsoap_scripts/liquidsoap.cfg", CONF_FILE_LIQUIDSOAP)) {
        echo "Could not copy liquidsoap.cfg to /etc/airtime/. Exiting.";
        exit(1);
    }
}
CreateIniFiles();
AirtimeIni::UpdateIniFiles();
echo PHP_EOL . "*** Updating Database Tables ***" . PHP_EOL;
AirtimeInstall::MigrateTablesToVersion(__DIR__, '20110402164819');
echo PHP_EOL . "*** Updating Pypo ***" . PHP_EOL;
system("python " . __DIR__ . "/../../../python_apps/pypo/install/pypo-install.py");
echo PHP_EOL . "*** Recorder Installation ***" . PHP_EOL;
system("python " . __DIR__ . "/../../../python_apps/show-recorder/install/recorder-install.py");