lilalo

changeset 107:54fbf2041159

l3cd
author devi
date Fri Aug 04 18:06:09 2006 +0300 (2006-08-04)
parents 53b890d1ae90
children 0d49f33696b3
files l3-cgi l3-frontend l3bashrc l3scripts
line diff
     1.1 --- a/l3-cgi	Fri Aug 04 17:41:31 2006 +0300
     1.2 +++ b/l3-cgi	Fri Aug 04 18:06:09 2006 +0300
     1.3 @@ -117,7 +117,9 @@
     1.4  else {
     1.5      # Вызов производится по URL
     1.6      $ENV{PATH_INFO} = "/".$ENV{PATH_INFO} unless $ENV{PATH_INFO} =~ m@^/@;
     1.7 +    #my ($skip, $training, $host, $user) = split /\//,$ENV{PATH_INFO},4;
     1.8      my ($skip, $training, $host, $user) = split /\//,$ENV{PATH_INFO},4;
     1.9 +    
    1.10  
    1.11      if (!$host || $host eq "index") {
    1.12          # Нам неизвестен курс или явно указан просмотр индекса
     2.1 --- a/l3-frontend	Fri Aug 04 17:41:31 2006 +0300
     2.2 +++ b/l3-frontend	Fri Aug 04 18:06:09 2006 +0300
     2.3 @@ -208,7 +208,7 @@
     2.4          $command =~ s/'//g;
     2.5          $frequency_of_command{$command}++;
     2.6          if (!$Commands_Description{$command}) {
     2.7 -            $mywi_cache_for{$command} ||= mywi_client ($command) || "";
     2.8 +            $mywi_cache_for{$command} ||= mywi_client($command) || "";
     2.9              my $mywi = join ("\n", grep(/\([18]|sh|script\)/, split(/\n/, $mywi_cache_for{$command})));
    2.10              $mywi =~ s/\s+/ /;
    2.11              if ($mywi !~ /^\s*$/) {
     3.1 --- a/l3bashrc	Fri Aug 04 17:41:31 2006 +0300
     3.2 +++ b/l3bashrc	Fri Aug 04 18:06:09 2006 +0300
     3.3 @@ -222,4 +222,24 @@
     3.4      ) >> $L3_HOME/$L3_SESSION_ID.info
     3.5  }
     3.6  
     3.7 +l3 ()
     3.8 +{
     3.9 +    case "$1" in
    3.10 +        on)
    3.11 +            echo switching on
    3.12 +        ;;
    3.13 +        off)
    3.14 +            echo switcing off
    3.15 +        ;;
    3.16 +        cd)
    3.17 +            echo l3cd="$2" > ~/.l3rc
    3.18 +        ;;
    3.19 +        pwd)
    3.20 +            grep ^l3cd= ~/.l3rc | sed s/[^=]*=//
    3.21 +        ;;
    3.22 +        *) 
    3.23 +            echo /usr/local/bin/l3
    3.24 +        ;;
    3.25 +    esac
    3.26 +}
    3.27  
     4.1 --- a/l3scripts	Fri Aug 04 17:41:31 2006 +0300
     4.2 +++ b/l3scripts	Fri Aug 04 18:06:09 2006 +0300
     4.3 @@ -18,6 +18,7 @@
     4.4  ssh $ssh_user@$host 'user=user;grep -q l3-agent /home/${user}/.bash_profile || { echo >> /home/${user}/.bash_profile ; cat /home/${user}/.bash_profile | sed 1s/^/l3-agent\\n/ > /tmp/$$$$l3 ; mv /tmp/$$$$l3 /home/${user}/.bash_profile; chown -R ${user} /home/${user}; }'
     4.5  ssh $ssh_user@$host 'cd /tmp; tar xfz Term-VT102*.gz; cd Term-VT102*[^z]; perl Makefile.PL; make ; make install'
     4.6  ssh $ssh_user@$host 'cd /tmp; tar xfz Text-Iconv*.gz; cd Text-Iconv*[^z]; perl Makefile.PL; make ; make install'
     4.7 +ssh $ssh_user@$host 'echo l3cd=trainings/$course/$date/$host/root > /root/.l3rc ; echo l3cd=trainings/$course/$date/$host/user > /home/user/.l3rc'
     4.8  }
     4.9  
    4.10  ###copy-lablogs