diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-02-27 03:28:43 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-02-27 03:28:43 +0000 |
commit | 746ca58a1c48e5b2f8d604b4dad5afcb0cbce12b (patch) | |
tree | fc37e86d49a0a580673132c3920921dffba9c2fe /usr/local/www/index.php | |
parent | 65b8734aef28969b946b2d2007760ed516e53047 (diff) | |
download | pfsense-746ca58a1c48e5b2f8d604b4dad5afcb0cbce12b.zip pfsense-746ca58a1c48e5b2f8d604b4dad5afcb0cbce12b.tar.gz |
Check if file exists before running command
Diffstat (limited to 'usr/local/www/index.php')
-rwxr-xr-x | usr/local/www/index.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr/local/www/index.php b/usr/local/www/index.php index 65afb5f..43cc751 100755 --- a/usr/local/www/index.php +++ b/usr/local/www/index.php @@ -56,8 +56,10 @@ ## Check to see if we have a swap space, ## if true, display, if false, hide it ... - $swapinfo = `/usr/sbin/swapinfo`; - if(stristr($swapinfo,'%') == true) $showswap=true; + if(file_exists("/usr/sbin/swapinfo")) { + $swapinfo = `/usr/sbin/swapinfo`; + if(stristr($swapinfo,'%') == true) $showswap=true; + } ## User recently restored his config. |