CC-5239
Upgrade: airtime.conf is not upgraded
This commit is contained in:
parent
05f462f388
commit
702db0f800
3 changed files with 129 additions and 0 deletions
28
install_minimal/upgrades/airtime-2.4.0/ConfFileUpgrade.php
Normal file
28
install_minimal/upgrades/airtime-2.4.0/ConfFileUpgrade.php
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
/* This class deals with any modifications to config files in /etc/airtime
|
||||
* as well as backups. All functions other than start() should be marked
|
||||
* as private. */
|
||||
class AirtimeConfigFileUpgrade{
|
||||
|
||||
public static function start(){
|
||||
echo "* Updating configFiles".PHP_EOL;
|
||||
self::UpdateIniFiles();
|
||||
}
|
||||
|
||||
/**
|
||||
* After the configuration files have been copied to /etc/airtime,
|
||||
* this function will update them to values unique to this
|
||||
* particular installation.
|
||||
*/
|
||||
private static function UpdateIniFiles()
|
||||
{
|
||||
$ini = parse_ini_file(UpgradeCommon::CONF_FILE_AIRTIME, true);
|
||||
|
||||
$ini['rabbitmq']['vhost'] = '/airtime';
|
||||
$ini['rabbitmq']['user'] = 'airtime';
|
||||
$ini['rabbitmq']['password'] = UpgradeCommon::GenerateRandomString();
|
||||
|
||||
UpgradeCommon::write_ini_file($ini, UpgradeCommon::CONF_FILE_AIRTIME, true);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue