#!/bin/bash # # This file: /etc/samba/script/profilecheck.sh # source /etc/samba/scripts.conf RNDM=$$ touch $LOGFILE chmod $LOGMODE $LOGFILE ( if [ ! -d ${PROFILEROOT}/$2 ];then if [ -f ${PROFILEROOT}/$2 ];then mv "${PROFILEROOT}/$2" "${PROFILEROOT}/$2.WHATDABEEP.${RNDM}" echo `date` Samba profiledir create: WEIRD ERROR... echo `date` Samba profiledir create: ${PROFILEROOT}/$2 exists but is a file, what the BEEP is going on here? echo `date` Samba profiledir create: ${PROFILEROOT}/$2 has been moved to ${PROFILEROOT}/$2.WHATDABEEP.${RNDM} fi mkdir "${PROFILEROOT}/$2" chmod ${PROFILEDIRMODE} "${PROFILEROOT}/$2" chown $2 "${PROFILEROOT}/$2" echo `date` Samba profiledir create: ${PROFILEROOT}/$2 has been created fi ) >>$LOGFILE