Skip to content
This repository was archived by the owner on Dec 9, 2019. It is now read-only.

Commit 00f0f96

Browse files
authored
[skip ci] Check for /etc/rc.local existence
1 parent a32e631 commit 00f0f96

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cli/Valet/DnsMasq.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ private function mergeDns()
9999
$this->files->ensureDirExists($optDir);
100100
$this->files->put($script, $this->files->get(__DIR__.'/../stubs/get-dns-servers'));
101101
$this->cli->run("chmod +x {$script}");
102+
103+
if (! $this->files->exists($this->rclocal)) {
104+
$this->files->put($this->rclocal, implode("\n", ['exit 0', '']));
105+
}
102106

103107
if (strpos($rclocal, $script) === false) {
104108
$this->files->backup($this->rclocal);
@@ -114,7 +118,6 @@ private function mergeDns()
114118

115119
$this->files->put($this->rclocal, implode("\n", $output));
116120
$this->cli->run("chmod +x {$this->rclocal}");
117-
$this->dnsWatch('restart');
118121
}
119122

120123
return true;
@@ -189,6 +192,7 @@ public function dnsmasqSetup()
189192
$this->files->putAsUser($this->nmConfigPath, $this->files->get(__DIR__.'/../stubs/networkmanager.conf'));
190193

191194
$this->lockResolvConf();
195+
$this->dnsWatch('restart');
192196
}
193197

194198
/**

0 commit comments

Comments
 (0)