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