Showing posts with label openldap. Show all posts
Showing posts with label openldap. Show all posts

08 March 2008

My Little Shell Script

I have a script that I used for many years as a tools for migration, installation and configuration in Linux and FreeBSD. I love my little script. It will read my input file, count the number of lines, read the lines one by one, cut the line and put it into input that I want. Echo it back into template that I've define and loop and loop until end of the lines.

That's my little shell script.

Quote is my shell script is a migration script of vpopmail passwd file into Linux passwd/shadow format so I can run migration tools from padl nss_ldap to create LDIF format (PosixAccount) that suitable to be used with DBmail.

But, Bro root script much more simpler that this and one liner if it can be. Hehehe.



#!/bin/bash
NOUID=500
TOTALL=`wc -l $1 | awk '{print $1}'`
KIRA=1
while [ $KIRA -le $TOTALL ]
do
echo "$KIRA"
BARIS1=`head -$KIRA $1 | tail -1`
NAMAUSER=`echo $BARIS1 | cut -d: -f1`
KATALALUAN=`echo $BARIS1 | cut -d: -f2`
NAMAPENUH=`echo $BARIS1 | cut -d: -f5`
NOUID=`expr $NOUID + 1`
#
### rpm:x:37:37::/var/lib/rpm:/sbin/nologin
echo "$NAMAUSER:x:$NOUID:12:$NAMAPENUH:/home/$NAMAUSER:/sbin/nologin" >> password$$.txt
echo "$NAMAUSER:$KATALALUAN:13941:0:99999:7:::" >> shadow$$.txt
#dbmail-users -v -a $NAMAUSER -wlaluan123 -p md5-base64 -m 100M -s $BARIS1
#
KIRA=`expr $KIRA + 1`
done
exit


07 March 2008

OpenLDAP And Me

I alway tell my friends, among Open Source products that I used to installed OpenLDAP is among the product that I need to do it more than 3 times, then it's will be right for me. On each of installation that I've done I will (after the installation, loading the LDIF, ldapsearch -x)

Shutdown the ldap service
service ldap stop

Recreate the OpenLDAP data directory

cd /var/lib
mv ldap ldap.old
mkdir /var/lib/ldap
chown ldap:ldap /var/lib/ldap

Start the ldap service
service ldap start

Haiya need to do it again. Remember I'm a Linux Centos guy. One OpenLDAP setup done, 3 more sites to go and 2 more to be confirm. :)

Thanks Khairil for the book. It's help a lot. I'm still with OpenLDAP and MySQL. Hehehe.

Need to know, want to know.

06 March 2008

Openldap with Mysql Backend

Spending my whole day trying to configure Openldap with Mysql as the backend. Stuck with numbers of configuration examples that each have it's own way and then around this hour (0020), while casual searching with Google, at the bottom of the Google search page. I found this link.

http://www.flatmtn.com/article/setting-ldap-back-sql

Detail explanation what need to be done, what to configure and how to do it.


Moral of the story. After 1730 is not a good time to do configuration, after whole day looking at the configuration files and eating a lot of kuaci, you mind blur already. Better go home, go for jogging, take a bath and doing nothing.

Google

My Blog List