You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
calculate-utils-2.1-client/data/login

44 lines
1.0 KiB

#! /bin/sh
env-update
source /etc/profile
# Очистим лог ошибок
echo "" > /var/log/cl_login-error.log
if [ -e '/usr/bin/cl-sync' ];
then
ERRORLOG=`/usr/bin/cl-sync --progress --color=never --login $USER`
# при неудачном выполнении, сгенерируем ошибку
if [ "$?" -gt "0" ];
then
echo $ERRORLOG > /var/log/cl_login-error.log
xmessage -buttons OK:0 -default OK "cl-sync:
$ERRORLOG"
exit 1
fi
fi
if [ -e '/usr/bin/cl-createhome' ];
then
ERRORLOG=`/usr/bin/cl-createhome --progress --color=never $USER`
# при неудачном выполнении, сгенерируем ошибку
if [ "$?" -gt "0" ];
then
echo $ERRORLOG >> /var/log/cl_login-error.log
ERRORLOG2=`/usr/bin/cl-sync --color=never --logout --nosync $USER`
if [ "$?" -gt "0" ];
then
xmessage -buttons OK:0 -default OK "cl-sync:
$ERRORLOG2"
fi
xmessage -buttons OK:0 -default OK "cl-createhome:
$ERRORLOG"
exit 1
fi
fi
#очистим кэш
/bin/rm -rf /var/tmp/kdecache-$USER
exit 0