|
|
@ -3,14 +3,14 @@ my $db = ${'zabbix-proxy'}{'DbName'} || 'zabbix'; |
|
|
|
my $user = ${'zabbix-proxy'}{'DbUser'} || 'zabbix'; |
|
|
|
my $user = ${'zabbix-proxy'}{'DbUser'} || 'zabbix'; |
|
|
|
my $pass = ${'zabbix-proxy'}{'DbPassword'} || 'secret'; |
|
|
|
my $pass = ${'zabbix-proxy'}{'DbPassword'} || 'secret'; |
|
|
|
|
|
|
|
|
|
|
|
my $schema = `rpm -qd zabbix-server | grep schema | grep mysql`; |
|
|
|
my $schema = `rpm -qd zabbix-proxy-mysql | grep schema | grep mysql`; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$OUT .= <<"END"; |
|
|
|
$OUT .= <<"END"; |
|
|
|
#! /bin/sh |
|
|
|
#! /bin/sh |
|
|
|
if [ \! -d /var/lib/mysql/$db ]; then |
|
|
|
if [ \! -d /var/lib/mysql/$db ]; then |
|
|
|
/usr/bin/mysqladmin create $db |
|
|
|
/usr/bin/mysqladmin create $db |
|
|
|
/usr/bin/mysql $db < $schema |
|
|
|
gzip -dc $schema | /usr/bin/mysql $db |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
/usr/bin/mysql <<EOF |
|
|
|
/usr/bin/mysql <<EOF |
|
|
|