diff options
author | Mark Crane <mcrane@pfsense.org> | 2008-12-27 02:15:03 +0000 |
---|---|---|
committer | Mark Crane <mcrane@pfsense.org> | 2008-12-27 02:15:03 +0000 |
commit | 975ceaa0bc10e81232128f94d514946f42bee36a (patch) | |
tree | 55bfa71fd16c211ed5d033d374f598394ce0bb6c /packages/tftp/tftp.inc | |
parent | 9ba11c79e570b185bb598ed4d46823fb7ac5cfa5 (diff) | |
download | pfsense-packages-975ceaa0bc10e81232128f94d514946f42bee36a.tar.gz pfsense-packages-975ceaa0bc10e81232128f94d514946f42bee36a.tar.bz2 pfsense-packages-975ceaa0bc10e81232128f94d514946f42bee36a.zip |
TFTP package add file size, adjust wording, fix backup.
Diffstat (limited to 'packages/tftp/tftp.inc')
-rw-r--r-- | packages/tftp/tftp.inc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/packages/tftp/tftp.inc b/packages/tftp/tftp.inc index 61a41a58..459ad8f5 100644 --- a/packages/tftp/tftp.inc +++ b/packages/tftp/tftp.inc @@ -68,6 +68,18 @@ function pkg_is_service_running($servicename) } } +function byte_convert( $bytes ) { + + if ($bytes<=0) + return '0 Byte'; + + $convention=1000; //[1000->10^x|1024->2^x] + $s=array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB'); + $e=floor(log($bytes,$convention)); + return round($bytes/pow($convention,$e),2).' '.$s[$e]; +} + + function php_sync_package() { @@ -104,6 +116,7 @@ function php_install_command() exec("tar zxvf /tmp/tftp.tgz -C /"); unlink_if_exists("/tmp/tftp.tgz"); + system('cd /;tar cvzf /tmp/tftp.bak.tgz tftpboot'); //rename PHP files from .tmp to .php |