Fix call to determine if a service is active

This commit is contained in:
Deon George 2023-07-06 11:34:42 +10:00
parent cf4116a268
commit 9762b8c2f4
2 changed files with 6 additions and 6 deletions

View File

@ -41,7 +41,7 @@ class ServerStart extends Command
$start = collect(); $start = collect();
if ($o->optionGet(Setup::O_BINKP)) if ($o->binkp_active)
$start->put('binkp',[ $start->put('binkp',[
'address'=>$o->binkp_bind, 'address'=>$o->binkp_bind,
'port'=>$o->binkp_port, 'port'=>$o->binkp_port,
@ -49,7 +49,7 @@ class ServerStart extends Command
'class'=>new Binkp($o), 'class'=>new Binkp($o),
]); ]);
if ($o->optionGet(Setup::O_EMSI)) if ($o->emsi_active)
$start->put('emsi',[ $start->put('emsi',[
'address'=>Setup::EMSI_BIND, 'address'=>Setup::EMSI_BIND,
'port'=>Setup::EMSI_PORT, 'port'=>Setup::EMSI_PORT,
@ -57,7 +57,7 @@ class ServerStart extends Command
'class'=>new EMSI($o), 'class'=>new EMSI($o),
]); ]);
if ($o->optionGet(Setup::O_DNS)) if ($o->dns_active)
$start->put('dns',[ $start->put('dns',[
'address'=>Setup::DNS_BIND, 'address'=>Setup::DNS_BIND,
'port'=>Setup::DNS_PORT, 'port'=>Setup::DNS_PORT,

View File

@ -130,17 +130,17 @@ class Setup extends Model
/* METHODS */ /* METHODS */
public function optionClear(int $key,$index='options'): void public function optionClear(int $key,$index='option_options'): void
{ {
$this->{$index} &= ~$key; $this->{$index} &= ~$key;
} }
public function optionGet(int $key,$index='options'): int public function optionGet(int $key,$index='option_options'): int
{ {
return ($this->{$index} & $key); return ($this->{$index} & $key);
} }
public function optionSet(int $key,$index='options'): void public function optionSet(int $key,$index='option_options'): void
{ {
$this->{$index} |= $key; $this->{$index} |= $key;
} }