-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathssh.sh
More file actions
75 lines (65 loc) · 2.01 KB
/
ssh.sh
File metadata and controls
75 lines (65 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
rm -rf public_html
git clone https://github.com/bovealexandre/blog-php.git public_html
cd public_html
cat >> .htaccess <<EOL
# For production, put your rewrite rules directly into your VirtualHost
# directive and turn off AllowOverride.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]
</IfModule>
EOL
read -p "Tapez le nom du serveur de votre base de données : " bddserver
read -p "Tapez le nom de votre base de données : " bddname
read -p "Tapez le nom d utilisateur de votre base de données : " bddusername
read -p "Tapez le mot de passe de votre base de données : " bddpass
cd app/app
if [ -f settings.php ]; then
rm -rf settings.php
fi
cat >> settings.php <<EOL
<?php
return [
'settings' => [
// Slim Settings
'determineRouteBeforeAppMiddleware' => false,
'displayErrorDetails' => true,
// View settings
'view' => [
'template_path' => __DIR__ . '/templates',
'twig' => [
'cache' => false, // __DIR__ . '/../cache/twig',
'debug' => true,
'auto_reload' => true,
],
],
// monolog settings
'logger' => [
'name' => 'app',
'path' => __DIR__ . '/log/app.log',
],
'db'=>[
'driver' => 'pgsql',
'host' => '$bddserver',
'database' => '$bddname',
'username' => '$bddusername',
'password' => '$bddpass',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
]
],
];
EOL
cd ../..
npm install
cd app
composer install
printf "$type\n"