~ubuntu-branches/ubuntu/vivid/389-ds-base/vivid-proposed

« back to all changes in this revision

Viewing changes to .pc/use-bash-instead-of-sh.diff/ldap/admin/src/scripts/dn2rdn.in

  • Committer: Package Import Robot
  • Author(s): Timo Aaltonen
  • Date: 2015-01-16 15:40:23 UTC
  • Revision ID: package-import@ubuntu.com-20150116154023-8gelb90338zoenea
Tags: 1.3.3.5-3
use-bash-instead-of-sh.diff: Drop admin_scripts.diff and patch the
scripts to use bash instead of trying to fix bashisms. (Closes:
#772195)

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 "@nss_libdir@"
 
7
libpath_add "@libdir@"
 
8
 
 
9
export LD_LIBRARY_PATH
 
10
SHLIB_PATH=$LD_LIBRARY_PATH
 
11
export SHLIB_PATH
 
12
      
 
13
usage ()
 
14
{
 
15
    echo "Usage: dn2rdn [-Z serverID] [-h] [-f] [-v] [-d debuglevel]"
 
16
    echo "Options:"
 
17
    echo "        -Z serverID    - Server instance identifier"
 
18
    echo "        -f             - Force upgrade"
 
19
    echo "        -v             - Display version"
 
20
    echo "        -d debuglevel  - Debugging level"
 
21
    echo "        -h             - Display usage"
 
22
}
 
23
    
 
24
while getopts "Z:d:ha:vfr:D:" flag
 
25
do
 
26
    case $flag in
 
27
        h) usage
 
28
           exit 0;;
 
29
        Z) servid=$OPTARG;;
 
30
        d) arg=$arg" -d $OPTARG";;
 
31
        a) arg=$arg" -a $OPTARG"
 
32
           archive="provided";;
 
33
        v) arg=$arg" -v";;
 
34
        f) arg=$arg" -f";;
 
35
        D) arg=$arg" -D $OPTARG";;
 
36
        ?) usage
 
37
           exit 1;;
 
38
    esac
 
39
done
 
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
servid=`normalize_server_id $initfile`
 
51
. $initfile
 
52
 
 
53
if [ "$archive" != "provided" ]; then
 
54
    bak_dir=@localstatedir@/lib/@PACKAGE_NAME@/slapd-$servid/bak/reindex_`date +%Y_%m_%d_%H_%M_%S`
 
55
    args=$args"-a $bak_dir"
 
56
fi
 
57
 
 
58
@sbindir@/ns-slapd upgradedb -D $CONFIG_DIR -r $args