File: install.sh

package info (click to toggle)
fusionforge 5.3.2%2B20141104-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 60,472 kB
  • sloc: php: 271,846; sql: 36,817; python: 14,575; perl: 6,406; sh: 5,980; xml: 4,294; pascal: 1,411; makefile: 911; cpp: 52; awk: 27
file content (26 lines) | stat: -rw-r--r-- 826 bytes parent folder | download | duplicates (4)
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
#! /bin/sh

p=$(forge_get_config plugins_path)/sysauthldap

if [ -x /usr/sbin/slapd ] && [ -x /usr/bin/ldapadd ] ; then
    if ! slapcat -b cn=schema,cn=config 2> /dev/null | egrep -q ^cn:.\{[[:digit:]]+\}gforge$ ; then
	$p/bin/schema2ldif.pl < $p/gforge.schema | ldapadd -H ldapi:/// -Y EXTERNAL -Q
    fi
fi

c=$(forge_get_config config_path)/config.ini.d/sysauthldap-secrets.ini
if ! [ -e "$c" ] ; then
    touch $c
    chmod 600 $c
    echo [sysauthldap] >> $c
    echo ldap_password = CHANGEME >> $c
fi

f=$(forge_get_config config_path)/httpd.conf.d/plugin-sysauthldap-secrets.inc
if [ ! -e $f ] ; then
    cp $(forge_get_config source_path)/etc/httpd.conf.d-fhs/plugin-sysauthldap-secrets.inc $f
    chmod 600 $f
    PATH=$(forge_get_config binary_path):$PATH manage-apache-config.sh install
    mv $f.generated $f
fi