PWS’s LDAP已死….

沒啦~~停掉而已
所以做個紀錄
這是之前偵測slapd有沒有掛掉的script~

#!/usr/local/bin/bash

shell name: watchdog.sh

while [ 1 = 1 ];
do
sleep 300
ps=ps ax > /root/ps.txt

p=grep "/usr/sbin/slapd start" /root/ps.txt | awk '{print $5}'
if [ "$p" != "/usr/sbin/slapd" ]; then
echo "slapd bye bye"
/usr/sbin/slapd start
sleep 5
fi
p=''
done

This entry was posted in Linux, OpenLDAP. Bookmark the permalink.