#!/bin/sh
#
# move config dir ~/.claws-mail to ~/.config/claws-mail
#
grep ":x:\([0-9]\)\{4\}:" /etc/passwd | awk -F":" '{ print $1, $6 }' |\
	while read huser hdir; do 
    [ -d $hdir/.claws-mail ] || continue;
    [ -d $hdir/.config/claws-mail ] && continue;
    ( cd $hdir;
    	echo "Move ~/.claws-mail .config/claws-mail for user $huser"
    	su $huser -c "mv .claws-mail .config/claws-mail "
    )
done
( cd usr/bin ; rm -rf sylpheed-claws )
( cd usr/bin ; ln -sf claws-mail sylpheed-claws )
