check_oracle_health: update to 1.9.3.5
[omd.git] / packages / dokuwiki / DOKUWIKI_AUTH.hook
blob8d6354e570f804e44c8c4b33ae9a57c1f2a2116d
1 #!/bin/bash
3 # Alias: Use Dokuwiki for user management
4 # Menu: Web GUI
5 # Description:
6 # Dokuwiki - on OMD available on the URL /$OMD_SITE/wiki - is not only
7 # a useful Wiki, but also implements a user management.
8 # If you enable this option, you will have Nagios, NagVis, Multisite and
9 # other web applications access the user database of Dokuwiki for authentication.
10 # Otherwise users are managed via the file ~/etc/passwd.
12 case "$1" in
13 default)
14 echo "off"
16 choices)
17 echo "on: enable - use Dokuwiki for user management"
18 echo "off: disable - edit etc/htpasswd manually"
20 set)
21 if [ "$2" == "on" ]
22 then
23 if [ ! -h ${OMD_ROOT}/etc/htpasswd ] || [ ! $(readlink ${OMD_ROOT}/etc/htpasswd) = "dokuwiki/users.auth.php" ]
24 then
25 mv ${OMD_ROOT}/etc/htpasswd ${OMD_ROOT}/etc/htpasswd.omd
26 ln -s dokuwiki/users.auth.php ${OMD_ROOT}/etc/htpasswd
27 else
28 ln -sf dokuwiki/users.auth.php ${OMD_ROOT}/etc/htpasswd
30 else
31 # Prevent destroying links showing anywhere else
32 if [ -h ${OMD_ROOT}/etc/htpasswd ] && [ $(readlink ${OMD_ROOT}/etc/htpasswd) = "dokuwiki/users.auth.php" ]
33 then
34 ln -sf htpasswd.omd ${OMD_ROOT}/etc/htpasswd
38 esac