#!/bin/sh
# DocumentId:	$Id: dpsyco-delsmbprofile,v 1.4 2001/09/28 15:11:02 ola Exp $
# Author:	$Author: ola $
# Date:		$Date: 2001/09/28 15:11:02 $
# Summary:
#	Deletes the user samba profile directory.

if [ -z "$1" ] ; then
    echo "No user specified, exiting."
    exit 0
fi

. /etc/dpsyco/defaults.conf
. /usr/share/dpsyco/delrestoredir.func

cat /etc/samba/smb.conf | grep -A 20 "^[[:space:]]*\[profiles\]" | grep -B 20 "^[[:space:]]*\[[^p]" | grep "^[[:space:]]*path[[:space:]]*=[[:space:]]*" | sed -e "s|^[[:space:]]*path[[:space:]]*=[[:space:]]*||;" | {
    read PROFPATH

    if [ -z "$PROFPATH" ] ; then
	echo "No profile path to disable."
	exit 0
    fi

    cd $PROFPATH
    deldir $1
}
