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

Commit

Permalink
Merge pull request #18 from ceesco53/dnsmasq-uninstall-fix
Browse files Browse the repository at this point in the history
valet uninstall should remove .valet and dnsmasq setting
  • Loading branch information
jmarcher authored Aug 8, 2016
2 parents 71678fd + c9d282e commit 84f69d8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cli/Valet/Caddy.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,14 @@ public function uninstall()
$this->cli->quietly('systemctl disable caddy.service');

$this->files->unlink($this->daemonPath);

// remove .valet files
$files = glob('/home/'.$_SERVER['SUDO_USER'].'/.valet/*'); // get all file names
foreach ($files as $file) { // iterate files
if (is_file($file)) {
unlink($file);
} // delete file
}
$this->cli->quietly('sed -i \'/conf-file=\/home\/'.$_SERVER['SUDO_USER'].'\/.valet\/dnsmasq.conf/d\' /etc/dnsmasq.conf');
$this->cli->quietly('systemctl daemon-reload');
}
}

0 comments on commit 84f69d8

Please sign in to comment.