lilalo

diff l3scripts @ 40:5e5878bd1b20

Скрипты lm вынесены в отдельный файл l3config
author devi
date Tue Nov 22 22:47:47 2005 +0200 (2005-11-22)
parents
children 6452bfe549d1
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/l3scripts	Tue Nov 22 22:47:47 2005 +0200
     1.3 @@ -0,0 +1,63 @@
     1.4 +###install
     1.5 +cat $sshkey | $lmssh $ssh_user@$host /bin/sh -c '"mkdir -p ~/.ssh; cat >>~/.ssh/authorized_keys; chmod 600 ~/.ssh/authorized_keys"'
     1.6 +
     1.7 +###install-lm
     1.8 +cat $lminstall | ssh $ssh_user@$host /bin/sh -s $dirs
     1.9 +scp l3config.pm l3-agent $ssh_user@$host:/usr/local/bin
    1.10 +
    1.11 +###install-pm
    1.12 +scp PM/* $ssh_user@$host:/tmp
    1.13 +ssh $ssh_user@$host 'cd /tmp; tar xfz Term-VT102*.gz; cd Term-VT102*[^z]; perl Makefile.PL; make ; make install'
    1.14 +#ssh $ssh_user@$host 'cd /tmp; tar xfz Text-Iconv*.gz; cd Text-Iconv*[^z]; perl Makefile.PL; make ; make install'
    1.15 +
    1.16 +###copy-lablogs
    1.17 +for i in $dirs
    1.18 +do
    1.19 +	mkdir -p $lablogs/${i##*/}
    1.20 +	scp -q $ssh_user@$host:${i}/.lilalo/* $lablogs/${i##*/}
    1.21 +done
    1.22 +
    1.23 +###setlab
    1.24 +for i in $dirs
    1.25 +do
    1.26 +	echo $lab | ssh $ssh_user@$host "cat > "${i}"/.labmaker/lab"
    1.27 +done
    1.28 +
    1.29 +###makeout
    1.30 +common=$course-$date
    1.31 +personal=$course-$date-$email
    1.32 +mkdir -p $outpath/${common}/{Lablogs,Docs}
    1.33 +mkdir -p $outpath/${personal}/{Course,Files}
    1.34 +cd $outpath/${personal}
    1.35 +ln -s ../${common}/Lablogs .
    1.36 +ln -s ../${common}/Docs .
    1.37 +cd ~-
    1.38 +export UG_PERSONAL=$outpath/${personal}/Course
    1.39 +export UG_CENTER="$center"
    1.40 +export UG_COURSE="$course"
    1.41 +export UG_DATE="$date"
    1.42 +export UG_STUDENT="$name"
    1.43 +export UG_COMPANY="$company"
    1.44 +export UG_MAIL="$email"
    1.45 +cd $coursepath; make personal; cd ~-
    1.46 +
    1.47 +###POST-makeout
    1.48 +rm -rf /tmp/$course-$date
    1.49 +mkdir /tmp/$course-$date
    1.50 +find $outpath/*$date* -name \*.pdf -exec cp {} /tmp/$course-$date/ \;
    1.51 +cd /tmp
    1.52 +zip -r $course-$date.zip $course-$date
    1.53 +mv $course-$date.zip /var/www/tmp/
    1.54 +mutt -s 'Сгенерированы методички' imchubin\@mail.ru <<LETTER
    1.55 +Сгенерированы методички для курса $course, который начинается $date.
    1.56 +
    1.57 +Архив файлов для печати можно получить по адресу:
    1.58 +http://chub.in/tmp/$course-$date.zip
    1.59 +Архив будет доступен по этому адресу в течение трех дней.
    1.60 +
    1.61 +--
    1.62 +WBR,i.m.chubin
    1.63 +LETTER
    1.64 +
    1.65 +###watch
    1.66 +cat taillast.pl | ssh $ssh_user@$host perl - /root/.labmaker