devi@40: ###install devi@40: cat $sshkey | $lmssh $ssh_user@$host /bin/sh -c '"mkdir -p ~/.ssh; cat >>~/.ssh/authorized_keys; chmod 600 ~/.ssh/authorized_keys"' devi@40: devi@40: ###install-lm devi@40: cat $lminstall | ssh $ssh_user@$host /bin/sh -s $dirs devi@40: scp l3config.pm l3-agent $ssh_user@$host:/usr/local/bin devi@40: devi@40: ###install-pm devi@40: scp PM/* $ssh_user@$host:/tmp devi@40: ssh $ssh_user@$host 'cd /tmp; tar xfz Term-VT102*.gz; cd Term-VT102*[^z]; perl Makefile.PL; make ; make install' devi@40: #ssh $ssh_user@$host 'cd /tmp; tar xfz Text-Iconv*.gz; cd Text-Iconv*[^z]; perl Makefile.PL; make ; make install' devi@40: devi@40: ###copy-lablogs devi@40: for i in $dirs devi@40: do devi@40: mkdir -p $lablogs/${i##*/} devi@40: scp -q $ssh_user@$host:${i}/.lilalo/* $lablogs/${i##*/} devi@40: done devi@40: devi@40: ###setlab devi@40: for i in $dirs devi@40: do devi@40: echo $lab | ssh $ssh_user@$host "cat > "${i}"/.labmaker/lab" devi@40: done devi@40: devi@40: ###makeout devi@40: common=$course-$date devi@40: personal=$course-$date-$email devi@40: mkdir -p $outpath/${common}/{Lablogs,Docs} devi@40: mkdir -p $outpath/${personal}/{Course,Files} devi@40: cd $outpath/${personal} devi@40: ln -s ../${common}/Lablogs . devi@40: ln -s ../${common}/Docs . devi@40: cd ~- devi@40: export UG_PERSONAL=$outpath/${personal}/Course devi@40: export UG_CENTER="$center" devi@40: export UG_COURSE="$course" devi@40: export UG_DATE="$date" devi@40: export UG_STUDENT="$name" devi@40: export UG_COMPANY="$company" devi@40: export UG_MAIL="$email" devi@40: cd $coursepath; make personal; cd ~- devi@40: devi@40: ###POST-makeout devi@40: rm -rf /tmp/$course-$date devi@40: mkdir /tmp/$course-$date devi@40: find $outpath/*$date* -name \*.pdf -exec cp {} /tmp/$course-$date/ \; devi@40: cd /tmp devi@41: rm -rf $course-$date.zip 2> /dev/null devi@40: zip -r $course-$date.zip $course-$date devi@40: mv $course-$date.zip /var/www/tmp/ devi@40: mutt -s 'Сгенерированы методички' imchubin\@mail.ru < /dev/null devi@41: mkdir /tmp/lilalo-$course-$date devi@41: cp -R /var/www/l3 /tmp/lilalo-$course-$date devi@41: cd /tmp devi@41: rm -rf lilalo-$course-$date.zip 2> /dev/null devi@41: zip -r lilalo-$course-$date.zip lilalo-$course-$date devi@41: devi@41: devi@41: ###send-logs devi@41: cat >> /tmp/letters <