Merge branch 'develop' of https://brutus.artica.lan:8081/artica/pandorafms into develop
This commit is contained in:
commit
0588633712
|
@ -7,10 +7,22 @@ use POSIX;
|
||||||
|
|
||||||
my $TOTAL=`vmstat -s | grep "total memory" | awk '{ print $1 } '`;
|
my $TOTAL=`vmstat -s | grep "total memory" | awk '{ print $1 } '`;
|
||||||
my $FREE=`vmstat -s | grep "free memory" | awk '{ print $1 } '`;
|
my $FREE=`vmstat -s | grep "free memory" | awk '{ print $1 } '`;
|
||||||
my $FREEP=($FREE/$TOTAL)*100;
|
my $FREEP;
|
||||||
|
eval {
|
||||||
|
$FREEP=($FREE/$TOTAL)*100;
|
||||||
|
};
|
||||||
|
if ($@) {
|
||||||
|
$FREEP = 0;
|
||||||
|
}
|
||||||
my $STOTAL=`vmstat -s | grep "total swap" | awk '{ print $1 } '`;
|
my $STOTAL=`vmstat -s | grep "total swap" | awk '{ print $1 } '`;
|
||||||
my $SUSED=`vmstat -s | grep "free swap" | awk '{ print $1 } '`;
|
my $SUSED=`vmstat -s | grep "free swap" | awk '{ print $1 } '`;
|
||||||
my $SFREE=($SUSED/$STOTAL)*100;
|
my $SFREE;
|
||||||
|
eval {
|
||||||
|
$SFREE=($SUSED/$STOTAL)*100;
|
||||||
|
};
|
||||||
|
if ($@) {
|
||||||
|
$SFREE = 0;
|
||||||
|
}
|
||||||
|
|
||||||
$SFREE = floor($SFREE);
|
$SFREE = floor($SFREE);
|
||||||
$FREEP = floor($FREEP);
|
$FREEP = floor($FREEP);
|
||||||
|
|
|
@ -56,6 +56,9 @@ function rrmdir($dir) {
|
||||||
reset($objects);
|
reset($objects);
|
||||||
rmdir($dir);
|
rmdir($dir);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
unlink ($dir);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_manager_install_package_step2() {
|
function update_manager_install_package_step2() {
|
||||||
|
@ -606,14 +609,19 @@ function update_manager_starting_update() {
|
||||||
"/downloads/last_package.tgz";
|
"/downloads/last_package.tgz";
|
||||||
|
|
||||||
$full_path = $config['attachment_store'] . "/downloads/pandora_console";
|
$full_path = $config['attachment_store'] . "/downloads/pandora_console";
|
||||||
rrmdir($full_path);
|
|
||||||
|
$phar = new PharData($path_package);
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
$result = system("tar xvzf " . $path_package .
|
try {
|
||||||
" -C " . $config['attachment_store'] . "/downloads/", $none);
|
$result = $phar->extractTo($config['attachment_store'] . "/downloads/");
|
||||||
|
}
|
||||||
|
catch (Exception $e) {
|
||||||
|
echo ' There\'s a problem ... -> ' . $e->getMessage();
|
||||||
|
}
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
|
|
||||||
|
rrmdir($path_package);
|
||||||
|
|
||||||
if ($result != 0) {
|
if ($result != 0) {
|
||||||
db_process_sql_update('tconfig',
|
db_process_sql_update('tconfig',
|
||||||
array('value' => json_encode(
|
array('value' => json_encode(
|
||||||
|
@ -640,7 +648,9 @@ function update_manager_starting_update() {
|
||||||
$full_path,
|
$full_path,
|
||||||
$homedir,
|
$homedir,
|
||||||
array('install.php'));
|
array('install.php'));
|
||||||
|
|
||||||
|
rrmdir($full_path);
|
||||||
|
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
db_process_sql_update('tconfig',
|
db_process_sql_update('tconfig',
|
||||||
array('value' => json_encode(
|
array('value' => json_encode(
|
||||||
|
|
Loading…
Reference in New Issue