summarylogtreecommitdiffstats
path: root/adminer.install
blob: 9a17b48cf0fd809caa53493fa7a0f6ade3eb2d8b (plain)
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
_instname='Adminer'
_instwww="${_instname,,}"
_instwww="${_instwww// /-}"
_inststr="Include conf/extra/httpd-${_instwww}.conf"
_instfile='/etc/httpd/conf/httpd.conf'

post_install() {
  if ! grep -ql "^${_inststr}"'$' "${_instfile}"; then
    local TEXT="
If you want to access ${_instname} by your Apache server, run following command as root:
echo '${_inststr}' >> '${_instfile}'

And restart your Apache running 'rc.d restart httpd'
Or (if you are using systemd) 'systemctl restart httpd'

After you can browse ${_instname} on http://localhost/${_instwww}";
    echo -e "${TEXT}"
  fi
}

post_upgrade() {
  post_install
}

post_remove() {
  if grep -ql "^${_inststr}"'$' "${_instfile}"; then
    echo "To completely remove ${_instname}, remove its include from ${_instfile}"
    echo 'and restart your httpd server'
  fi
}