diff options
author | PiBa-NL <pba_2k3@yahoo.com> | 2014-05-14 19:26:52 +0200 |
---|---|---|
committer | PiBa-NL <pba_2k3@yahoo.com> | 2014-05-14 19:26:52 +0200 |
commit | 81714335cddd6a59c21cd1b48fb1c07286722d9c (patch) | |
tree | 7dd7fbe9307e4bb9d9b5ddbbdf08b34c5f54af63 /config/tinc | |
parent | 9e6166c1047d1310646b4f42690e9f5130a8ae86 (diff) | |
download | pfsense-packages-81714335cddd6a59c21cd1b48fb1c07286722d9c.tar.gz pfsense-packages-81714335cddd6a59c21cd1b48fb1c07286722d9c.tar.bz2 pfsense-packages-81714335cddd6a59c21cd1b48fb1c07286722d9c.zip |
tinc, as commented on previous commit removed {...} block around the for-loops + whitespace changed to tabs
Diffstat (limited to 'config/tinc')
-rw-r--r-- | config/tinc/status_tinc.php | 70 |
1 files changed, 34 insertions, 36 deletions
diff --git a/config/tinc/status_tinc.php b/config/tinc/status_tinc.php index 86ad5b29..f50ea640 100644 --- a/config/tinc/status_tinc.php +++ b/config/tinc/status_tinc.php @@ -14,25 +14,24 @@ function tinc_status_1() { $clog_path = "/usr/sbin/clog"; } - if (!empty($clog_path)) { + if (!empty($clog_path)) exec("{$clog_path} /var/log/tinc.log | sed -e 's/.*tinc\[.*\]: //'",$result); - $i=0; - foreach($result as $line) - { - if(preg_match("/Connections:/",$line)) - $begin=$i; - if(preg_match("/End of connections./",$line)) - $end=$i; - $i++; - } - $output=""; - $i=0; - foreach($result as $line) - { - if($i >= $begin && $i<= $end) - $output .= $line . "\n"; - $i++; - } + $i=0; + foreach($result as $line) + { + if(preg_match("/Connections:/",$line)) + $begin=$i; + if(preg_match("/End of connections./",$line)) + $end=$i; + $i++; + } + $output=""; + $i=0; + foreach($result as $line) + { + if($i >= $begin && $i<= $end) + $output .= $line . "\n"; + $i++; } return $output; } @@ -48,25 +47,24 @@ function tinc_status_2() { $clog_path = "/usr/sbin/clog"; } - if (!empty($clog_path)) { + if (!empty($clog_path)) exec("{$clog_path} /var/log/tinc.log | sed -e 's/.*tinc\[.*\]: //'",$result); - $i=0; - foreach($result as $line) - { - if(preg_match("/Statistics for Generic BSD tun device/",$line)) - $begin=$i; - if(preg_match("/End of subnet list./",$line)) - $end=$i; - $i++; - } - $output=""; - $i=0; - foreach($result as $line) - { - if($i >= $begin && $i<= $end) - $output .= $line . "\n"; - $i++; - } + $i=0; + foreach($result as $line) + { + if(preg_match("/Statistics for Generic BSD tun device/",$line)) + $begin=$i; + if(preg_match("/End of subnet list./",$line)) + $end=$i; + $i++; + } + $output=""; + $i=0; + foreach($result as $line) + { + if($i >= $begin && $i<= $end) + $output .= $line . "\n"; + $i++; } return $output; } |