Skip to content

Commit 30072af

Browse files
authored
Merge pull request #450 from Aler1x/feat/update-dnsmasq
Feat add start, restart. stop and status commands for dnsmasq
2 parents e97535f + 88c50a5 commit 30072af

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

cli/Valet/DnsMasq.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,46 @@ public function updateDomain($oldDomain, $newDomain)
174174
$this->sm->restart('dnsmasq');
175175
}
176176

177+
/**
178+
* Start the DnsMasq service.
179+
*
180+
* @return void
181+
*/
182+
public function start()
183+
{
184+
$this->sm->start('dnsmasq');
185+
}
186+
187+
/**
188+
* Restart the DnsMasq service.
189+
*
190+
* @return void
191+
*/
192+
public function restart()
193+
{
194+
$this->sm->restart('dnsmasq');
195+
}
196+
197+
/**
198+
* Stop the DnsMasq service.
199+
*
200+
* @return void
201+
*/
202+
public function stop()
203+
{
204+
$this->sm->stop('dnsmasq');
205+
}
206+
207+
/**
208+
* DnsMasq service status.
209+
*
210+
* @return void
211+
*/
212+
public function status()
213+
{
214+
$this->sm->printStatus('dnsmasq');
215+
}
216+
177217
/**
178218
* Delete the DnsMasq config file.
179219
*

cli/valet.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@
145145
$app->command('status', function () {
146146
PhpFpm::status();
147147
Nginx::status();
148+
DnsMasq::status();
148149
})->descriptions('View Valet service status');
149150

150151
/**
@@ -288,6 +289,7 @@
288289
$app->command('start', function () {
289290
PhpFpm::restart();
290291
Nginx::restart();
292+
DnsMasq::restart();
291293

292294
info('Valet services have been started.');
293295
})->descriptions('Start the Valet services');
@@ -298,6 +300,7 @@
298300
$app->command('restart', function () {
299301
PhpFpm::restart();
300302
Nginx::restart();
303+
DnsMasq::restart();
301304

302305
info('Valet services have been restarted.');
303306
})->descriptions('Restart the Valet services');
@@ -308,6 +311,7 @@
308311
$app->command('stop', function () {
309312
PhpFpm::stop();
310313
Nginx::stop();
314+
DnsMasq::stop();
311315

312316
info('Valet services have been stopped.');
313317
})->descriptions('Stop the Valet services');

0 commit comments

Comments
 (0)