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 ! type perl > /dev/null 2>& 1; then
|
||||||
if uname | grep -i 'darwin' > /dev/null; 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
|
exit 1
|
||||||
fi
|
fi
|
||||||
rl=1
|
rl=1
|
||||||
@ -50,9 +50,13 @@ for arg in "$@"; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
if test $daemon -eq 1; then
|
if test $daemon -eq 1; then
|
||||||
|
# And yet again, OSX doesn't support something.
|
||||||
if ! type setsid > /dev/null 2>& 1; then
|
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
|
fi
|
||||||
(
|
(
|
||||||
setsid "${dir}/${cmd}" "$@" > /dev/null 2>& 1 &
|
setsid "${dir}/${cmd}" "$@" > /dev/null 2>& 1 &
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user