Changeset 301792f


Ignore:
Timestamp:
02/05/15 11:10:15 (4 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, enter/10, releng/10.1.2
Children:
19292c61
Parents:
7352997
Message:

For AppCafe? web interface, when updates are happening display the log
instead of the interface

Location:
src-webui/appweb/share/html
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src-webui/appweb/share/html/include/functions.php

    rdc59eb6 r301792f  
    433433} 
    434434 
     435function check_update_reboot() { 
     436  // Check if the system is waiting to reboot 
     437  if ( ($sysType == "DESKTOP" or $sysType == "SERVER") and file_exists("/tmp/.rebootRequired") ) 
     438  { 
     439     exec("who -b", $wout); 
     440     exec("cat /tmp/.rebootRequired", $rout); 
     441     if ( $wout == $rout ) { 
     442       echo "<center>The system is waiting to reboot from updating, please reboot before installing packages!</center>"; 
     443       exit(0); 
     444     } 
     445  } 
     446 
     447  // Check if the system is updating 
     448  if ( file_exists("/tmp/.updateInProgress") ) 
     449  { 
     450     exec("pgrep -qF /tmp/.updateInProgress ; echo $?", $rout); 
     451     if ( $rout[0] == "0" ) { 
     452       exec("tail -20 /var/log/pc-updatemanager.log", $logout); 
     453       echo "<meta http-equiv=\"refresh\" content=\"4\">"; 
     454       echo "<center>The system is updating, please wait for this to finish before installing packages!</center><br>"; 
     455       echo "<hr>"; 
     456       echo "<pre>"; 
     457       foreach($logout as $line) 
     458         echo "$line\n"; 
     459       echo "</pre>"; 
     460       exit(0); 
     461     } 
     462  } 
     463 
     464  return 0; 
     465} 
     466 
    435467?> 
  • src-webui/appweb/share/html/index.php

    r52c8ac2 r301792f  
    2525    else 
    2626      $sysType="SERVER"; 
    27   } 
    28  
    29   // Check if the system is waiting to reboot 
    30   if ( ($sysType == "DESKTOP" or $sysType == "SERVER") and file_exists("/tmp/.rebootRequired") ) 
    31   { 
    32      exec("who -b", $wout); 
    33      exec("cat /tmp/.rebootRequired", $rout); 
    34      if ( $wout == $rout ) { 
    35        echo "<center>The system is waiting to reboot from updating, please reboot before installing packages!</center>"; 
    36        exit(0); 
    37      } 
    3827  } 
    3928 
     
    9584  require("include/functions.php"); 
    9685 
     86  // Check if we have updates to display 
     87  check_update_reboot(); 
     88 
    9789  // Do any install / delete requests 
    9890  if ( ! empty($_GET["deleteApp"]) ) 
Note: See TracChangeset for help on using the changeset viewer.