--- a/ldap/admin/src/scripts/bak2db.in
+++ b/ldap/admin/src/scripts/bak2db.in
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-source @datadir@/@package_name@/data/DSSharedLib
+. @datadir@/@package_name@/data/DSSharedLib
 
 libpath_add "@libdir@/@package_name@/"
 libpath_add "@nss_libdir@"
@@ -26,15 +26,18 @@ if [ $# -lt 1 ] || [ $# -gt 7 ]
 then
     usage
     exit 1
-elif [[ $1 == -* ]]
-then
-    usage
-    exit 1
-else
-    archivedir=$1
-    shift
 fi
-    
+case $1 in
+    -*)
+        usage
+        exit 1
+        ;;
+    *)
+        archivedir=$1
+        shift
+        ;;
+esac
+
 while getopts "hn:Z:qd:vi:a:SD:" flag
 do
     case $flag in
--- a/ldap/admin/src/scripts/db2bak.in
+++ b/ldap/admin/src/scripts/db2bak.in
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-source @datadir@/@package_name@/data/DSSharedLib
+. @datadir@/@package_name@/data/DSSharedLib
 
 libpath_add "@libdir@/@package_name@/"
 libpath_add "@nss_libdir@"
@@ -21,20 +21,21 @@ usage()
     echo "        -h           - Display usage"  
 }
 
-if [ $# -gt 4 ]
+if [ $# -lt 1 ] || [ $# -gt 4 ]
 then
     usage
     exit 1
 fi
-
-if [ "$#" -gt 0 ]
-then
-    if [[ $1 != -* ]]
-    then
+case $1 in
+    -*)
+        usage
+        exit 1
+        ;;
+    *)
         bak_dir=$1
         shift
-    fi
-fi
+        ;;
+esac
 
 while getopts "hqd:Z:vi:a:SD" flag
 do
--- a/ldap/admin/src/scripts/db2index.in
+++ b/ldap/admin/src/scripts/db2index.in
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-source @datadir@/@package_name@/data/DSSharedLib
+. @datadir@/@package_name@/data/DSSharedLib
 
 libpath_add "@libdir@/@package_name@/"
 libpath_add "@nss_libdir@"
--- a/ldap/admin/src/scripts/db2ldif.in
+++ b/ldap/admin/src/scripts/db2ldif.in
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-source @datadir@/@package_name@/data/DSSharedLib
+. @datadir@/@package_name@/data/DSSharedLib
 
 libpath_add "@libdir@/@package_name@/"
 libpath_add "@nss_libdir@"
--- a/ldap/admin/src/scripts/dbverify.in
+++ b/ldap/admin/src/scripts/dbverify.in
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-source @datadir@/@package_name@/data/DSSharedLib
+. @datadir@/@package_name@/data/DSSharedLib
 
 libpath_add "@libdir@/@package_name@/"
 libpath_add "@nss_libdir@"
--- a/ldap/admin/src/scripts/dn2rdn.in
+++ b/ldap/admin/src/scripts/dn2rdn.in
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-source @datadir@/@package_name@/data/DSSharedLib
+. @datadir@/@package_name@/data/DSSharedLib
 
 libpath_add "@libdir@/@package_name@/"
 libpath_add "@nss_libdir@"
--- a/ldap/admin/src/scripts/ldif2db.in
+++ b/ldap/admin/src/scripts/ldif2db.in
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-source @datadir@/@package_name@/data/DSSharedLib
+. @datadir@/@package_name@/data/DSSharedLib
 
 libpath_add "@libdir@/@package_name@/"
 libpath_add "@nss_libdir@"
--- a/ldap/admin/src/scripts/ldif2ldap.in
+++ b/ldap/admin/src/scripts/ldif2ldap.in
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-source @datadir@/@package_name@/data/DSSharedLib
+. @datadir@/@package_name@/data/DSSharedLib
 
 libpath_add "@ldapsdk_libdir@"
 libpath_add "@libdir@"
--- a/ldap/admin/src/scripts/monitor.in
+++ b/ldap/admin/src/scripts/monitor.in
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-source @datadir@/@package_name@/data/DSSharedLib
+. @datadir@/@package_name@/data/DSSharedLib
 
 libpath_add "@libdir@/@package_name@/"
 libpath_add "@ldapsdk_libdir@"
--- a/ldap/admin/src/scripts/restart-dirsrv.in
+++ b/ldap/admin/src/scripts/restart-dirsrv.in
@@ -7,7 +7,7 @@
 #       2: Server started successfully (was not running)
 #       3: Server could not be stopped
 
-source @datadir@/@package_name@/data/DSSharedLib
+. @datadir@/@package_name@/data/DSSharedLib
 
 restart_instance() {
     SERV_ID=$1
--- a/ldap/admin/src/scripts/restoreconfig.in
+++ b/ldap/admin/src/scripts/restoreconfig.in
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-source @datadir@/@package_name@/data/DSSharedLib
+. @datadir@/@package_name@/data/DSSharedLib
 
 libpath_add "@libdir@/@package_name@/"
 libpath_add "@nss_libdir@"
--- a/ldap/admin/src/scripts/saveconfig.in
+++ b/ldap/admin/src/scripts/saveconfig.in
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-source @datadir@/@package_name@/data/DSSharedLib
+. @datadir@/@package_name@/data/DSSharedLib
 
 libpath_add "@libdir@/@package_name@/"
 libpath_add "@libdir@"
--- a/ldap/admin/src/scripts/start-dirsrv.in
+++ b/ldap/admin/src/scripts/start-dirsrv.in
@@ -6,7 +6,7 @@
 #       1: Server could not be started
 #       2: Server already running
 
-source @datadir@/@package_name@/data/DSSharedLib
+. @datadir@/@package_name@/data/DSSharedLib
 
 # Starts a single instance
 start_instance() {
--- a/ldap/admin/src/scripts/stop-dirsrv.in
+++ b/ldap/admin/src/scripts/stop-dirsrv.in
@@ -6,7 +6,7 @@
 #       1: Server could not be stopped
 #       2: Server was not running
 
-source @datadir@/@package_name@/data/DSSharedLib
+. @datadir@/@package_name@/data/DSSharedLib
 
 stop_instance() {
     SERV_ID=$1
--- a/ldap/admin/src/scripts/suffix2instance.in
+++ b/ldap/admin/src/scripts/suffix2instance.in
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-source @datadir@/@package_name@/data/DSSharedLib
+. @datadir@/@package_name@/data/DSSharedLib
 
 libpath_add "@libdir@/@package_name@/"
 libpath_add "@libdir@"
--- a/ldap/admin/src/scripts/upgradedb.in
+++ b/ldap/admin/src/scripts/upgradedb.in
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-source @datadir@/@package_name@/data/DSSharedLib
+. @datadir@/@package_name@/data/DSSharedLib
 
 libpath_add "@libdir@/@package_name@/"
 libpath_add "@libdir@"
--- a/ldap/admin/src/scripts/upgradednformat.in
+++ b/ldap/admin/src/scripts/upgradednformat.in
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-source @datadir@/@package_name@/data/DSSharedLib
+. @datadir@/@package_name@/data/DSSharedLib
 
 # upgradednformat -- upgrade DN format to the new style (RFC 4514)
 # Usgae: upgradednformat [-N] -n backend_instance -a db_instance_directory
--- a/ldap/admin/src/scripts/vlvindex.in
+++ b/ldap/admin/src/scripts/vlvindex.in
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-source @datadir@/@package_name@/data/DSSharedLib
+. @datadir@/@package_name@/data/DSSharedLib
 
 libpath_add "@libdir@/@package_name@/"
 libpath_add "@libdir@"
--- a/ldap/admin/src/scripts/DSSharedLib.in
+++ b/ldap/admin/src/scripts/DSSharedLib.in
@@ -135,48 +135,44 @@ process_dse ()
     configdir=$1
     pid=$2
     file="$configdir/dse.ldif"
-    shopt -s nocasematch
-    OLD_IFC=$IFC
+    OLD_IFS=$IFS
     IFS=""
     while read -r LINE
     do
-        if [[ $LINE !=  \ * ]] && [ "$output" != "" ]
-        then
-            echo "$output" >> /tmp/DSSharedLib.$pid
-            output=""
-        fi
-        if [ "$output" != "" ] && [[ $LINE == \ * ]]
-        then
-            # continuation line, strip the space and append it
-            LINE=`echo "$LINE" | sed -e 's/^ //'`
-            output=$output$LINE
-        elif [[ $LINE == nsslapd-port* ]]
-        then
-            output=$LINE;
-        elif [[ $LINE == nsslapd-localhost* ]]
-        then
-            output=$LINE;
-        elif [[ $LINE == nsslapd-securePort* ]]
-        then
-            output=$LINE;
-        elif [[ $LINE == nsslapd-security* ]]
-        then
-            output=$LINE;
-        elif [[ $LINE == nsslapd-ldapilisten* ]]
-        then
-            output=$LINE;
-        elif [[ $LINE == nsslapd-ldapifilepath* ]]
-        then
-            output=$LINE;
-        elif [[ $LINE == nsslapd-rootdn* ]]
-        then
-            output=$LINE;
-        elif [[ $LINE == nsslapd-ldapiautobind* ]]
-        then
-            output=$LINE;
-        elif [[ $LINE == nsslapd-certdir* ]]
-        then
-            output=$LINE;
+        case $LINE in
+            ' '*)
+                ;;
+            *)
+                if [ "$output" != "" ]
+                then
+                    echo "$output" >> /tmp/DSSharedLib.$pid
+                    output=""
+                fi
+                ;;
+        esac
+        if [ "$output" != "" ]
+        then
+            case $LINE in
+                ' '*)
+                    # continuation line, strip the space and append it
+                    LINE=`echo "$LINE" | sed -e 's/^ //'`
+                    output=$output$LINE
+                    ;;
+            esac
+        else
+            case $LINE in
+                nsslapd-certdir*|\
+                nsslapd-ldapiautobind*|\
+                nsslapd-ldapilisten*|\
+                nsslapd-ldapifilepath*|\
+                nsslapd-localhost*|\
+                nsslapd-port*|\
+                nsslapd-rootdn*|\
+                nsslapd-securePort*|\
+                nsslapd-security*)
+                    output=$LINE
+                    ;;
+            esac
         fi
     
     done < $file
@@ -224,4 +220,4 @@ check_protocol ()
     fi
 
     echo "$protocol"
-}
\ No newline at end of file
+}
