summarylogtreecommitdiffstats
path: root/adminer-editor.install
blob: 15cc6fc6513803477ec494c632e5262cb12bc6c3 (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 Editor'
_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
}