~ubuntu-branches/ubuntu/trusty/389-ds-base/trusty

« back to all changes in this revision

Viewing changes to ldap/admin/src/scripts/suffix2instance.in

  • Committer: Package Import Robot
  • Author(s): Timo Aaltonen
  • Date: 2013-08-30 00:31:55 UTC
  • mfrom: (1.2.1)
  • Revision ID: package-import@ubuntu.com-20130830003155-oimuzdqopkvp2cd0
Tags: 1.3.1.7-0ubuntu1
Sync from unreleased debian git.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
source @datadir@/@package_name@/data/DSSharedLib
 
4
 
 
5
libpath_add "@libdir@/@package_name@/"
 
6
libpath_add "@libdir@"
 
7
libpath_add "@nss_libdir@"
 
8
libpath_add "@pcre_libdir@"
 
9
 
 
10
export LD_LIBRARY_PATH
 
11
SHLIB_PATH=$LD_LIBRARY_PATH
 
12
export SHLIB_PATH
 
13
 
 
14
usage ()
 
15
{
 
16
    echo "Usage: suffix2instance [-Z serverID] -s suffix [-h]"
 
17
    echo "Options:"
 
18
    echo "        -Z serverID  - Server instance identifier"
 
19
    echo "        -s suffix    - Suffix used to map to backend instance"
 
20
    echo "        -h           - Display usage"
 
21
}
 
22
 
 
23
while getopts "Z:s:h" flag
 
24
do
 
25
    case $flag in
 
26
        Z) servid=$OPTARG;;
 
27
        s) args=$args" -s $OPTARG";;
 
28
        h) usage
 
29
           exit 0;;
 
30
        ?) usage
 
31
           exit 1;;
 
32
    esac
 
33
done
 
34
 
 
35
if [ "$args" == "" ]
 
36
then
 
37
    usage
 
38
    exit 1
 
39
fi
 
40
 
 
41
initfile=$(get_init_file "@initconfigdir@" $servid)
 
42
if [ $? == 1 ]
 
43
then
 
44
    usage
 
45
    echo "You must supply a valid server instance identifier.  Use -Z to specify instance name"
 
46
    echo "Available instances: $initfile"
 
47
    exit 1
 
48
fi
 
49
 
 
50
. $initfile
 
51
 
 
52
if [ $# -lt 2 ]
 
53
then
 
54
    echo Usage: suffix2instance [-Z serverID] {-s includesuffix}*
 
55
    exit 1
 
56
fi
 
57
 
 
58
@sbindir@/ns-slapd suffix2instance -D $CONFIG_DIR $args 2>&1