1 |
diff -up smeserver-cacti-0.8.8b/root/etc/e-smith/templates/etc/e-smith/sql/init/80cacti.patch2 smeserver-cacti-0.8.8b/root/etc/e-smith/templates/etc/e-smith/sql/init/80cacti |
2 |
--- smeserver-cacti-0.8.8b/root/etc/e-smith/templates/etc/e-smith/sql/init/80cacti.patch2 2013-10-18 16:14:47.000000000 -0400 |
3 |
+++ smeserver-cacti-0.8.8b/root/etc/e-smith/templates/etc/e-smith/sql/init/80cacti 2013-10-18 16:14:34.000000000 -0400 |
4 |
@@ -0,0 +1,20 @@ |
5 |
+{ |
6 |
+ my $db = $cacti{DbName} || 'cacti_sme'; |
7 |
+ my $user = $cacti{DbUser} || 'cacti'; |
8 |
+ my $pass = $cacti{DbPassword} || 'changeme'; |
9 |
+ $OUT .= <<END |
10 |
+#! /bin/sh |
11 |
+ if [ -d /var/lib/mysql/$db ]; then |
12 |
+ exit |
13 |
+ fi |
14 |
+ /usr/bin/mysql <<EOF |
15 |
+ CREATE DATABASE $db DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; |
16 |
+ use $db; |
17 |
+ use mysql; |
18 |
+ GRANT ALL PRIVILEGES ON $db.* TO $user\@localhost |
19 |
+ IDENTIFIED BY '$pass'; |
20 |
+ flush privileges; |
21 |
+EOF |
22 |
+ /usr/bin/mysql $db < /etc/e-smith/db/configuration/migrate/80cacti_sme.sql |
23 |
+END |
24 |
+} |
25 |
\ Pas de fin de ligne à la fin du fichier. |