summarylogtreecommitdiffstats
path: root/adminer.install
diff options
context:
space:
mode:
authorChris Severance2015-08-20 07:42:44 -0400
committerChris Severance2015-08-20 07:42:44 -0400
commit8545edee8773a154b1251c2f63820b65fee3ac51 (patch)
tree10385d96260a8daa110d49423d07f8d837a3d3e6 /adminer.install
parentc85570da2d140a89ed1134eecc5facf533841beb (diff)
downloadaur-8545edee8773a154b1251c2f63820b65fee3ac51.tar.gz
Adjustable www name, fix version
Diffstat (limited to 'adminer.install')
-rw-r--r--adminer.install33
1 files changed, 23 insertions, 10 deletions
diff --git a/adminer.install b/adminer.install
index 4e4ac3de7b2f..9a17b48cf0fd 100644
--- a/adminer.install
+++ b/adminer.install
@@ -1,17 +1,30 @@
-TEXT='
-If you want to access adminer interface by your apache server, run following command as root:\n
-echo "Include conf/extra/httpd-adminer.conf" >> /etc/httpd/conf/httpd.conf\n\n
+_instname='Adminer'
+_instwww="${_instname,,}"
+_instwww="${_instwww// /-}"
+_inststr="Include conf/extra/httpd-${_instwww}.conf"
+_instfile='/etc/httpd/conf/httpd.conf'
-And restart your apache running "rc.d restart httpd"\n
-Or (if you are using systemd) "systemctl restart httpd"\n\n
-
-After you can browse adminer on http://localhost/adminer\n';
+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'
-post_install() {
- echo -e $TEXT;
+After you can browse ${_instname} on http://localhost/${_instwww}";
+ echo -e "${TEXT}"
+ fi
}
post_upgrade() {
- echo -e $TEXT;
+ 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
}