diff options
author | jim-p <jimp@pfsense.org> | 2015-02-09 12:41:10 -0500 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2015-02-09 12:46:11 -0500 |
commit | 306d00ec65567e2202246941bbdeab3d8d5b0327 (patch) | |
tree | 33b3f70de450bf3f7b8fd06b43dd58b853966bd6 | |
parent | 74c48e73b1bb0c4ce9776d52c1e883b5d7c6de8f (diff) | |
download | pfsense-packages-306d00ec65567e2202246941bbdeab3d8d5b0327.tar.gz pfsense-packages-306d00ec65567e2202246941bbdeab3d8d5b0327.tar.bz2 pfsense-packages-306d00ec65567e2202246941bbdeab3d8d5b0327.zip |
Some misc fomatting fixes for bacula; Don't add sections that depend on LocalDirector being set if it hasn't been set yet.
-rw-r--r-- | config/bacula-client/bacula-client.inc | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/config/bacula-client/bacula-client.inc b/config/bacula-client/bacula-client.inc index f14c4e5c..7553cdb4 100644 --- a/config/bacula-client/bacula-client.inc +++ b/config/bacula-client/bacula-client.inc @@ -88,21 +88,23 @@ function baculaclient_custom_php_write_config(){ // create Director switch ($bc['type']){ case "Director": - $baculaclient_conf .= "Director { \n\t Name = {$bc['director']}-dir #{$bc['description']}\n\t Password = \"{$bc['password']}\"\n\t}\n"; + $baculaclient_conf .= "Director { \n\tName = {$bc['director']}-dir #{$bc['description']}\n\tPassword = \"{$bc['password']}\"\n}\n"; Break; case "Monitor": - $baculaclient_conf .= "Director { \n\t Name = {$bc['director']}-mon #{$bc['description']}\n\t Password = \"{$bc['password']}\"\n\t Monitor = yes\n\t}\n"; + $baculaclient_conf .= "Director { \n\tName = {$bc['director']}-mon #{$bc['description']}\n\tPassword = \"{$bc['password']}\"\n\tMonitor = yes\n}\n"; break; case "Local": - $baculaclient_conf .= "Director { \n\t Name = {$bc['director']}-dir #{$bc['description']}\n\t Password = \"{$bc['password']}\"\n\t}\n"; - $baculaclient_conf .= "Director { \n\t Name = {$bc['director']}-mon #{$bc['description']}\n\t Password = \"{$bc['password']}\"\n\t Monitor = yes\n\t}\n"; + $baculaclient_conf .= "Director { \n\tName = {$bc['director']}-dir #{$bc['description']}\n\tPassword = \"{$bc['password']}\"\n}\n"; + $baculaclient_conf .= "Director { \n\tName = {$bc['director']}-mon #{$bc['description']}\n\tPassword = \"{$bc['password']}\"\n\tMonitor = yes\n}\n"; $LocalDirector = $bc['director']; } } // create Messages - $baculaclient_conf .= "Messages { \n\t Name = Standard \n\t director = {$LocalDirector}-dir = all, !skipped, !restored\n\t}\n"; + if (!empty($LocalDirector)) { + $baculaclient_conf .= "Messages { \n\tName = Standard \n\tdirector = {$LocalDirector}-dir = all, !skipped, !restored\n}\n"; + } // create FielDaemon if (is_array($config['installedpackages']['baculaclientfd']['config'])){ @@ -113,7 +115,10 @@ function baculaclient_custom_php_write_config(){ $port="9102"; $jobs="20"; } - $baculaclient_conf .= "FileDaemon { \n\t Name = {$LocalDirector}-fd #\n\t FDport = {$port}\n\t WorkingDirectory = /var/db/bacula\n\t Pid Directory = /var/run\n\tMaximum Concurrent Jobs = {$jobs}\n\t}\n"; + if (!empty($LocalDirector)) { + $baculaclient_conf .= "FileDaemon { \n\tName = {$LocalDirector}-fd #\n\tFDport = {$port}\n\tWorkingDirectory = /var/db/bacula\n\tPid Directory = /var/run\n\tMaximum Concurrent Jobs = {$jobs}\n}\n"; + } + file_put_contents(BACULA_LOCALBASE."/etc/bacula/bacula-fd.conf",$baculaclient_conf,LOCK_EX); exec(BACULA_STARTUP_SCRIPT . " restart"); // Mount Read-only |