File: install

package info (click to toggle)
ldapscripts 1.4-2
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 232 kB
  • ctags: 4
  • sloc: sh: 231; makefile: 10
file content (73 lines) | stat: -rwxr-xr-x 2,393 bytes parent folder | download | duplicates (2)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/sh

#  Copyright (C) 2005 Ganal LAPLANCHE - Linagora
#
#  This program is free software; you can redistribute it and/or
#  modify it under the terms of the GNU General Public License
#  as published by the Free Software Foundation; either version 2
#  of the License, or (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
#  USA.

# Specify absolute paths here
BINDIR="/usr/local/bin"
MANDIR="/usr/share/man"
ETCDIR="/etc/ldapscripts"
RUNTIMEDIR="/etc/ldapscripts"
ETCFILE="ldapscripts.conf"
RUNTIMEFILE="runtime"

# Prepare sources
sed -i.orig -e "s|^_RUNTIMEFILE=.*|_RUNTIMEFILE=\"${RUNTIMEDIR}/${RUNTIMEFILE}\"|g" bin/*
sed -i.orig -e "s|^_CONFIGFILE=.*|_CONFIGFILE=\"${ETCDIR}/${ETCFILE}\"|g" etc/*

# Script files
mkdir -p "${BINDIR}" 2>/dev/null
cp bin/_ldapdeletemachine "${BINDIR}"
cp bin/_ldaprenamegroup "${BINDIR}"
cp bin/_ldaprenamemachine "${BINDIR}"
cp bin/_ldapinit "${BINDIR}"
cp bin/_lsldap "${BINDIR}"
cp bin/ldapaddgroup "${BINDIR}"
cp bin/ldapadduser "${BINDIR}"
cp bin/ldapdeletegroup "${BINDIR}"
cp bin/ldapdeleteuserfromgroup "${BINDIR}"
cp bin/ldapsetprimarygroup "${BINDIR}"
cp bin/ldapaddmachine "${BINDIR}"
cp bin/ldapaddusertogroup "${BINDIR}"
cp bin/ldapdeleteuser "${BINDIR}"
cp bin/ldaprenameuser "${BINDIR}"

# Man pages
mkdir -p "${MANDIR}"/man1 2>/dev/null
for i in man/man1/*
do
	cat "${i}" | gzip - > "${MANDIR}"/man1/`basename ${i}`.gz
done
mkdir -p "${MANDIR}"/man5 2>/dev/null
for i in man/man5/*
do
	cat "${i}" | gzip - > "${MANDIR}"/man5/`basename ${i}`.gz
done

# Configuration and runtime files
mkdir -p "${ETCDIR}" 2>/dev/null
if [ -f "${ETCDIR}/${ETCFILE}" ]
then
  mv "${ETCDIR}/${ETCFILE}" "${ETCDIR}/${ETCFILE}.old"
  echo "Old configuration file found, saved under ${ETCDIR}/${ETCFILE}.old"
fi
cp etc/ldapscripts.conf "${ETCDIR}/${ETCFILE}"

mkdir -p "${RUNTIMEDIR}" 2>/dev/null
cp etc/runtime "${RUNTIMEDIR}/${RUNTIMEFILE}"

echo "Ldapscripts are now installed ! See README for more details..."