From 1301dff7c1549dbedfdc67dbfba6a6170d9dbf2d Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Tue, 7 Oct 2008 02:32:45 +0000 Subject: * Use fread() * Touch last backup status file if it does not exist --- packages/autoconfigbackup/crypt_acb.php | 5 ++++- packages/autoconfigbackup/upload_config_filter.php | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'packages/autoconfigbackup') diff --git a/packages/autoconfigbackup/crypt_acb.php b/packages/autoconfigbackup/crypt_acb.php index 8c56dcaf..ba12af80 100644 --- a/packages/autoconfigbackup/crypt_acb.php +++ b/packages/autoconfigbackup/crypt_acb.php @@ -43,7 +43,10 @@ fwrite($pipes[0], $data); fclose($pipes[0]); - $rslt = stream_get_contents($pipes[1]); + while (!feof($pipes[1])) { + $rslt .= fread($pipes[1], 8192); + } + fclose($pipes[1]); proc_close($fp); diff --git a/packages/autoconfigbackup/upload_config_filter.php b/packages/autoconfigbackup/upload_config_filter.php index 935f8d7b..d26f697d 100644 --- a/packages/autoconfigbackup/upload_config_filter.php +++ b/packages/autoconfigbackup/upload_config_filter.php @@ -15,6 +15,12 @@ if(strstr($pfSversion, "1.2")) */ // Define some needed variables +if(!file_exists("/cf/conf/lastpfSbackup.txt")) { + conf_mount_rw(); + touch("/cf/conf/lastpfSbackup.txt"); + conf_mount_ro(); +} + $last_backup_date = str_replace("\n", "", file_get_contents("/cf/conf/lastpfSbackup.txt")); $last_config_change = $config['revision']['time']; $hostname = $config['system']['hostname']; -- cgit v1.2.3