forked from grrnikos/pma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpma.sh
43 lines (31 loc) · 1.16 KB
/
pma.sh
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
#!/bin/bash
sudo apt-get -qq update
sudo apt-get -qq -y install unzip
echo 'Downloading latest phpMyAdmin'
curl -s -#L https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-english.tar.gz -o phpmyadmin.tar.gz
mkdir phpmyadmin && tar xf phpmyadmin.tar.gz -C phpmyadmin --strip-components 1
rm phpmyadmin.tar.gz
cat << 'EOL' >> phpmyadmin/config.inc.php
<?php
$i = 1;
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'homestead';
$cfg['Servers'][$i]['password'] = 'secret';
$cfg['ThemeDefault']= 'metro';
EOL
echo 'Installing phpMyAdmin theme'
wget --quiet https://files.phpmyadmin.net/themes/metro/2.5/metro-2.5.zip -O temp.zip; unzip -q temp.zip
mv metro phpmyadmin/themes
rm temp.zip
CERT_CMD=/vagrant/vendor/laravel/homestead/scripts/create-certificate.sh
SERVE_CMD=/vagrant/vendor/laravel/homestead/scripts/serve-laravel.sh
if [ ! -f $CMD ]; then
echo "Older version detected."
# fallback for older versions
CMD=/vagrant/scripts/serve.sh
fi
echo "Creating certificate"
sudo bash $CERT_CMD phpmyadmin.app
echo "Serving new phpmyadmin.app"
sudo bash $SERVE_CMD phpmyadmin.app $(pwd)/phpmyadmin
sudo systemctl restart nginx.service