diff --git a/data/client b/data/client new file mode 100644 index 0000000..f9265e0 --- /dev/null +++ b/data/client @@ -0,0 +1,36 @@ +#!/sbin/runscript + +depend() { + use localmount + after bootmisc consolefont modules netmount + after readahead-list ypbind autofs openvpn gpm lircmd + after cupsd fbcondecor sshd cron + before xdm + use acpid consolekit hald xfs +} + +start() { + # Mount remote Samba filesystems. + ebegin "Mounting domain resources" + # Identifing domen server by env file + SERVER=`cat /var/calculate/calculate.env | grep cl_remote_host | awk '{print \$3}'` + let COUNT=20 + while let "${COUNT} > 0"; + do + if ping -w2 -c1 $SERVER &>/dev/null; + then + break; + else + sleep 1; + fi + let COUNT=COUNT-1 + done + cl-client --mount + eend $? "Some samba remote resources to mount" +} +stop(){ + ebegin "Unmount domain resources" + umount /var/calculate/remote +} + +# vim:ts=4 diff --git a/data/cmd_login b/data/cmd_login new file mode 100644 index 0000000..f850e81 --- /dev/null +++ b/data/cmd_login @@ -0,0 +1,11 @@ +#! /bin/sh + +if [ -e '/var/log/cl_login-error.log' ]; +then + ERROR=`cat /var/log/cl_login-error.log` + if [ $ERROR ]; + then + exit 1 + fi +fi +exit 0 \ No newline at end of file diff --git a/data/login b/data/login new file mode 100644 index 0000000..e82d6bd --- /dev/null +++ b/data/login @@ -0,0 +1,43 @@ +#! /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 diff --git a/data/logout b/data/logout new file mode 100644 index 0000000..b015d75 --- /dev/null +++ b/data/logout @@ -0,0 +1,14 @@ +#! /bin/sh + +if [ -e '/usr/bin/cl-sync' ]; +then + /usr/bin/cl-sync --logout $USER + # при неудачном выполнении, сгенерируем ошибку + if [ "$?" -gt "0" ]; + then + echo 'ERROR' + exit 1 + fi +fi + +exit 0