Skip to content
Snippets Groups Projects
Commit 8f27630d authored by jurgenhaas's avatar jurgenhaas
Browse files

Move update script to customer inventory

parent a3293eb6
No related branches found
No related tags found
No related merge requests found
<?php
/**
* Script for the Proxy txr1 to grab domain changes for homepage products.
*
* @see SV-26726
*/
$db_host = $argv[1];
$db_port = $argv[2];
$db_user = $argv[3];
$db_pass = $argv[4];
$db = $argv[5];
$path = $argv[6];
$myname = $argv[7];
$changed = FALSE;
try {
$dbh = new PDO('mysql:host='.$db_host.';port='.$db_port.';dbname='.$db, $db_user, $db_pass, array(PDO::ATTR_PERSISTENT => false));
foreach ($dbh->query('select * from variable where name="sverein_proxy_settings_'.$myname.'"') as $row) {
$settings = unserialize($row['value']);
foreach ($settings as $host => $domains) {
$changed = TRUE;
file_put_contents($path . '/' . $host . '.crm.list', implode("\n", $domains));
}
}
if ($changed) {
$dbh->query('delete from variable where name="sverein_proxy_settings_'.$myname.'"');
}
}
catch (Exception $e) {}
exit($changed ? 99 : 0);
......@@ -48,14 +48,6 @@
mode='644'
notify: 'Proxy | Restart HAProxy'
- name: "Proxy | Install update php script"
copy:
src='etc_haproxy_update_update_php'
dest='/etc/haproxy/update/update.php'
owner='root'
group='root'
mode='444'
- name: "Proxy | Update blacklists"
template:
src='{{ item }}'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment