From e02912ec02a6a2f78c41eda1455ca3b29166a9f3 Mon Sep 17 00:00:00 2001 From: laf Date: Mon, 10 Aug 2015 23:45:41 +0000 Subject: [PATCH] Removed unused files --- upgrade-scripts/fix-billing-2758.inc.php | 87 ---------- upgrade-scripts/fix-events.php | 20 --- upgrade-scripts/fix-port-rrd.php | 202 ----------------------- upgrade-scripts/fix-sensor-rrd.php | 81 --------- 4 files changed, 390 deletions(-) delete mode 100644 upgrade-scripts/fix-billing-2758.inc.php delete mode 100755 upgrade-scripts/fix-events.php delete mode 100755 upgrade-scripts/fix-port-rrd.php delete mode 100755 upgrade-scripts/fix-sensor-rrd.php diff --git a/upgrade-scripts/fix-billing-2758.inc.php b/upgrade-scripts/fix-billing-2758.inc.php deleted file mode 100644 index 89716c6940..0000000000 --- a/upgrade-scripts/fix-billing-2758.inc.php +++ /dev/null @@ -1,87 +0,0 @@ - 0) { - $bill_data['bill_quota'] = $bill_data['bill_gb'] * $config['billing']['base'] * $config['billing']['base']; - dbUpdate(array('bill_quota' => $bill_data['bill_quota']), 'bills', '`bill_id` = ?', array($bill_data['bill_id'])); - echo("Quota -> ".$bill_data['bill_quota']); - } - - if($bill_data['bill_cdr'] > 0) { - $bill_data['bill_cdr'] = $bill_data['bill_cdr'] * 1000; - dbUpdate(array('bill_cdr' => $bill_data['bill_cdr']), 'bills', '`bill_id` = ?', array($bill_data['bill_id'])); - echo("CDR -> ".$bill_data['bill_cdr']); - } - echo("\n"); -} - -mysql_query("ALTER TABLE `bills` DROP `bill_gb`"); - -?> diff --git a/upgrade-scripts/fix-events.php b/upgrade-scripts/fix-events.php deleted file mode 100755 index 02d235b3ea..0000000000 --- a/upgrade-scripts/fix-events.php +++ /dev/null @@ -1,20 +0,0 @@ - 1) { - echo (round((($i / $count) * 100), 2)."% \r"); - } -} - - -function getDirectoryTree($outerDir, &$files=array()) -{ - $dirs = array_diff(scandir($outerDir), array( '.', '..' )); - foreach ($dirs as $d) { - if (is_dir($outerDir.'/'.$d)) { - getDirectoryTree($outerDir.'/'.$d, $files); - } - else { - if (preg_match('/^[\d]+.rrd$/', $d)) { - array_push($files, preg_replace('/\/+/', '/', $outerDir.'/'.$d)); - } - } - } - - return $files; - -}//end getDirectoryTree() - - -function fixRdd($file) -{ - global $config; - global $rrdcached; - $fileC = shell_exec("{$config['rrdtool']} dump $file $rrdcached"); - - // --------------------------------------------------------------------------------------------------------- - $first = << - INDISCARDS - DERIVE - 600 - 0.0000000000e+00 - 1.2500000000e+10 - - UNKN - 0.0000000000e+00 - 0 - - - OUTDISCARDS - DERIVE - 600 - 0.0000000000e+00 - 1.2500000000e+10 - - UNKN - 0.0000000000e+00 - 0 - - - INUNKNOWNPROTOS - DERIVE - 600 - 0.0000000000e+00 - 1.2500000000e+10 - - UNKN - 0.0000000000e+00 - 0 - - - INBROADCASTPKTS - DERIVE - 600 - 0.0000000000e+00 - 1.2500000000e+10 - - UNKN - 0.0000000000e+00 - 0 - - - OUTBROADCASTPKTS - DERIVE - 600 - 0.0000000000e+00 - 1.2500000000e+10 - - UNKN - 0.0000000000e+00 - 0 - - - INMULTICASTPKTS - DERIVE - 600 - 0.0000000000e+00 - 1.2500000000e+10 - - UNKN - 0.0000000000e+00 - 0 - - - OUTMULTICASTPKTS - DERIVE - 600 - 0.0000000000e+00 - 1.2500000000e+10 - - UNKN - 0.0000000000e+00 - 0 - - - -FIRST; - - $second = << - 0.0000000000e+00 - NaN - NaN - 0 - - - 0.0000000000e+00 - NaN - NaN - 0 - - - 0.0000000000e+00 - NaN - NaN - 0 - - - 0.0000000000e+00 - NaN - NaN - 0 - - - 0.0000000000e+00 - NaN - NaN - 0 - - - 0.0000000000e+00 - NaN - NaN - 0 - - - 0.0000000000e+00 - NaN - NaN - 0 - - -SECOND; - - $third = << NaN NaN NaN NaN NaN NaN NaN -THIRD; - - // --------------------------------------------------------------------------------------------------------- - if (!preg_match('/DISCARDS/', $fileC)) { - $fileC = str_replace('', $first, $fileC); - $fileC = str_replace('', $second, $fileC); - $fileC = str_replace('', $third, $fileC); - $tmpfname = tempnam('/tmp', 'OBS'); - file_put_contents($tmpfname, $fileC); - @unlink($file); - $newfile = preg_replace('/(\d+)\.rrd/', 'port-\\1.rrd', $file); - @unlink($newfile); - shell_exec($config['rrdtool']." restore $tmpfname $newfile"); - unlink($tmpfname); - } - -}//end fixRdd() - - -echo "\n"; diff --git a/upgrade-scripts/fix-sensor-rrd.php b/upgrade-scripts/fix-sensor-rrd.php deleted file mode 100755 index e508dbf2df..0000000000 --- a/upgrade-scripts/fix-sensor-rrd.php +++ /dev/null @@ -1,81 +0,0 @@ - 1) { - echo (round((($i / $count) * 100), 2)."% \r"); - } -} - - -function sensor_getDirectoryTree($outerDir, &$files=array()) -{ - - $dirs = array_diff(scandir($outerDir), array( '.', '..' )); - foreach ($dirs as $d) { - if (is_dir($outerDir.'/'.$d)) { - sensor_getDirectoryTree($outerDir.'/'.$d, $files); - } - else { - if ((preg_match('/^fan-.*.rrd$/', $d)) - || (preg_match('/^current-.*.rrd$/', $d)) - || (preg_match('/^freq-.*.rrd$/', $d)) - || (preg_match('/^humidity-.*.rrd$/', $d)) - || (preg_match('/^volt-.*.rrd$/', $d)) - || (preg_match('/^temp-.*.rrd$/', $d)) - ) { - array_push($files, preg_replace('/\/+/', '/', $outerDir.'/'.$d)); - } - } - } - - return $files; - -} - - -function sensor_fixRdd($file) -{ - global $config; - global $rrdcached; - $fileC = shell_exec("{$config['rrdtool']} dump $file $rrdcached"); - if (preg_match('/ fan/', $fileC)) { - shell_exec("{$config['rrdtool']} tune $file $rrdcached -r fan:sensor"); - rename($file, str_replace('/fan-', '/fanspeed-', $file)); - } - else if (preg_match('/ volt/', $fileC)) { - shell_exec("{$config['rrdtool']} tune $file $rrdcached -r volt:sensor"); - rename($file, str_replace('/volt-', '/voltage-', $file)); - } - else if (preg_match('/ current/', $fileC)) { - shell_exec("{$config['rrdtool']} tune $file $rrdcached -r current:sensor"); - } - else if (preg_match('/ freq/', $fileC)) { - shell_exec("{$config['rrdtool']} tune $file $rrdcached -r freq:sensor"); - rename($file, str_replace('/freq-', '/frequency-', $file)); - } - else if (preg_match('/ humidity/', $fileC)) { - shell_exec("{$config['rrdtool']} tune $file $rrdcached -r humidity:sensor"); - } - else if (preg_match('/ temp/', $fileC)) { - shell_exec("{$config['rrdtool']} tune $file $rrdcached -r temp:sensor"); - rename($file, str_replace('/temp-', '/temperature-', $file)); - } - -} - - -echo "\n";