|
|
|
@ -19,13 +19,24 @@ source /usr/share/calculate/xdm/functions
|
|
|
|
|
|
|
|
|
|
if [ -e '/usr/bin/cl-desktop' ];
|
|
|
|
|
then
|
|
|
|
|
ERRORLOG=`/usr/bin/cl-desktop --progress --color=never $USER 2>&1`
|
|
|
|
|
# при неудачном выполнении, сгенерируем ошибку
|
|
|
|
|
if [ "$?" -gt "0" ];
|
|
|
|
|
# skip desktop configure if user not domain and it already has home dir
|
|
|
|
|
# with not /etc/skel contents
|
|
|
|
|
userHome=`getent passwd $USER | awk -F: '{ print( $6 ); }'`
|
|
|
|
|
if [[ "${DOMAIN_USER}" == "on" ]] ||
|
|
|
|
|
! [[ -d "${userHome}" ]] ||
|
|
|
|
|
[[ -z "`ls ${userHome}`" ]] ||
|
|
|
|
|
diff -uq <(ls -A1 /etc/skel | wc) <(ls -A1 ${userHome} | sort) &>/dev/null
|
|
|
|
|
then
|
|
|
|
|
echo "$ERRORLOG" >> $FILE_LOG
|
|
|
|
|
xmes cl-desktop "$ERRORLOG"
|
|
|
|
|
exit 1
|
|
|
|
|
ERRORLOG=`/usr/bin/cl-desktop --progress --color=never $USER 2>&1`
|
|
|
|
|
# raise xmessage error if cl-desktop failed
|
|
|
|
|
if [ "$?" -gt "0" ];
|
|
|
|
|
then
|
|
|
|
|
# write error message to logfile
|
|
|
|
|
echo "$ERRORLOG" >> $FILE_LOG
|
|
|
|
|
# display error by xmessage
|
|
|
|
|
xmes cl-desktop "$ERRORLOG"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
exit 0
|
|
|
|
|