-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathphppgadmin.sh
25 lines (21 loc) · 977 Bytes
/
phppgadmin.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
#!/bin/bash
# Install phpPgAdmin
if [ -d "/usr/share/phpPgAdmin" ]
then
echo "phpPgAdmin is already installed, nothing done!"
else
HTTPD=`which httpd`
if [[ $HTTPD == "*no httpd*" ]]
then
echo "No httpd service found, skipping phpPgAdmin setup"
else
yum install -y phpPgAdmin
cp -f /vagrant/vagrant-setup/pgsql/phpPgAdmin.conf /etc/httpd/conf.d/
systemctl restart httpd.service
#
PHPCONF=/etc/phpPgAdmin/config.inc.php
perl -pi -e "s/\x24conf\x5B'servers'\x5D\x5B0\x5D\x5B'host'\x5D\s*=\s*''/\x24conf\x5B'servers'\x5D\x5B0\x5D\x5B'host'\x5D = '192\x2E168\x2E101\x2E110'\\1/g" $PHPCONF
perl -pi -e "s/\x24conf\x5B'servers'\x5D\x5B0\x5D\x5B'pg_dump_path'\x5D\s*=\s*''/\x24conf\x5B'servers'\x5D\x5B0\x5D\x5B'pg_dump_path'\x5D = '\x2Fbin\x2Fpg_dump'\\1/g" $PHPCONF
perl -pi -e "s/\x24conf\x5B'servers'\x5D\x5B0\x5D\x5B'pg_dumpall_path'\x5D\s*=\s*''/\x24conf\x5B'servers'\x5D\x5B0\x5D\x5B'pg_dumpall_path'\x5D = '\x2Fbin\x2Fpg_dumpall'\\1/g" $PHPCONF
fi
fi