bin: get --daemon working on OSX.
This commit is contained in:
parent
bade290765
commit
1085ce6f27
10
bin/bcoin
10
bin/bcoin
@ -6,7 +6,7 @@ cmd='node'
|
||||
|
||||
if ! type perl > /dev/null 2>& 1; then
|
||||
if uname | grep -i 'darwin' > /dev/null; then
|
||||
echo 'Bcoin requires perl to start.' >& 2
|
||||
echo 'Bcoin requires perl to start on OSX.' >& 2
|
||||
exit 1
|
||||
fi
|
||||
rl=1
|
||||
@ -50,9 +50,13 @@ for arg in "$@"; do
|
||||
done
|
||||
|
||||
if test $daemon -eq 1; then
|
||||
# And yet again, OSX doesn't support something.
|
||||
if ! type setsid > /dev/null 2>& 1; then
|
||||
echo 'Bcoin requires setsid to start as a daemon.' >& 2
|
||||
exit 1
|
||||
(
|
||||
"${dir}/${cmd}" "$@" > /dev/null 2>& 1 &
|
||||
echo "$!"
|
||||
)
|
||||
exit 0
|
||||
fi
|
||||
(
|
||||
setsid "${dir}/${cmd}" "$@" > /dev/null 2>& 1 &
|
||||
|
||||
Loading…
Reference in New Issue
Block a user