diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-10-07 02:32:45 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-10-07 02:32:45 +0000 |
commit | 1301dff7c1549dbedfdc67dbfba6a6170d9dbf2d (patch) | |
tree | 8f0db810cf1a0d3855dcf63d21e10f101bda3367 /packages/autoconfigbackup | |
parent | 6a2dcae70d1851b05cd68293ebf4c5e99a7cc034 (diff) | |
download | pfsense-packages-1301dff7c1549dbedfdc67dbfba6a6170d9dbf2d.tar.gz pfsense-packages-1301dff7c1549dbedfdc67dbfba6a6170d9dbf2d.tar.bz2 pfsense-packages-1301dff7c1549dbedfdc67dbfba6a6170d9dbf2d.zip |
* Use fread()
* Touch last backup status file if it does not exist
Diffstat (limited to 'packages/autoconfigbackup')
-rw-r--r-- | packages/autoconfigbackup/crypt_acb.php | 5 | ||||
-rw-r--r-- | packages/autoconfigbackup/upload_config_filter.php | 6 |
2 files changed, 10 insertions, 1 deletions
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']; |