This repository was archived by the owner on Dec 9, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,6 @@ private function _mergeDns()
86
86
$ this ->files ->backup ($ this ->resolvconf );
87
87
$ this ->files ->unlink ($ this ->resolvconf );
88
88
$ this ->files ->symlink ($ script , $ this ->resolvconf );
89
- $ this ->sm ->start ('valet-dns ' );
90
89
91
90
return true ;
92
91
}
@@ -105,6 +104,7 @@ public function install($domain = 'test')
105
104
$ this ->createCustomConfigFile ($ domain );
106
105
$ this ->pm ->nmRestart ($ this ->sm );
107
106
$ this ->sm ->restart ('dnsmasq ' );
107
+ $ this ->sm ->start ('valet-dns ' );
108
108
}
109
109
110
110
/**
Original file line number Diff line number Diff line change 14
14
15
15
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
16
16
PIDFILE=/opt/valet-linux/watch.pid
17
+ LOGFILE=/opt/valet-linux/watch.log
17
18
DAEMON=/opt/valet-linux/valet-dns
18
19
NAME=valet-dns
19
20
DESC=" Valet DNS Resolution"
@@ -26,13 +27,16 @@ test -x $DAEMON || exit 0
26
27
. /lib/lsb/init-functions
27
28
28
29
start () {
29
- test -f $PIDFILE && rm $PIDFILE
30
+ test -f " $PIDFILE " && rm " $PIDFILE "
30
31
start-stop-daemon --start --pidfile $PIDFILE --exec $DAEMON start || return 2
31
32
}
32
33
33
34
stop () {
34
- start-stop-daemon --stop --retry=$STOP_SCHEDULE --pidfile $PIDFILE || return 1
35
- test -f $PIDFILE && rm $PIDFILE
35
+ if [ -f " $PIDFILE " ]; then
36
+ start-stop-daemon --stop --retry=$STOP_SCHEDULE --pidfile $PIDFILE && rm " $PIDFILE " || return 1
37
+ fi
38
+
39
+ test -f " $LOGFILE " && rm " $LOGFILE "
36
40
}
37
41
38
42
case " $1 " in
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ function watchDirs() {
92
92
local WATCHERS=(${DIRS[@]} " $DNSHEAD " )
93
93
94
94
# Log which directories are being watched
95
- echo " Watching the following directories:" >> " $LOGFILE "
95
+ echo " Watching the following directories for changes :" >> " $LOGFILE "
96
96
97
97
for DIR in " ${DIRS[@]} " ; do
98
98
echo " - $DIR " >> " $LOGFILE "
@@ -163,7 +163,12 @@ function restart {
163
163
}
164
164
165
165
function status {
166
- cat ' /opt/valet-linux/watch.log'
166
+ if [[ -f " $LOGFILE " ]]; then
167
+ echo -e " Valet DNS service is running correctly.\n"
168
+ cat ' /opt/valet-linux/watch.log'
169
+ else
170
+ echo " Valet DNS service is not running."
171
+ fi
167
172
}
168
173
169
174
case " $1 " in
You can’t perform that action at this time.
0 commit comments