Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: change shebangs in scripts and some shellcheck fixes #1176

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions bin/bcoin
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash
#!/usr/bin/env bash

rl=0
daemon=0
cmd='node'

if ! type perl > /dev/null 2>& 1; then
if uname | grep -i 'darwin' > /dev/null; then
echo 'Bcoin requires perl to start on OSX.' >& 2
if ! type perl >/dev/null 2>&1; then
if uname | grep -i 'darwin' >/dev/null; then
echo 'Bcoin requires perl to start on OSX.' >&2
exit 1
fi
rl=1
Expand All @@ -22,44 +22,44 @@ fi

dir=$(dirname "$file")

if test x"$1" = x'cli'; then
if test "$1" = 'cli'; then
shift
exec "${dir}/cli" "$@"
exit 1
fi

if test x"$1" = x'wallet'; then
if test "$1" = 'wallet'; then
exec "${dir}/cli" "$@"
exit 1
fi

if test x"$1" = x'rpc'; then
if test "$1" = 'rpc'; then
exec "${dir}/cli" "$@"
exit 1
fi

for arg in "$@"; do
case "$arg" in
--daemon)
daemon=1
--daemon)
daemon=1
;;
--spv)
cmd='spvnode'
--spv)
cmd='spvnode'
;;
esac
done

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
(
"${dir}/${cmd}" "$@" > /dev/null 2>& 1 &
"${dir}/${cmd}" "$@" >/dev/null 2>&1 &
echo "$!"
)
exit 0
fi
(
setsid "${dir}/${cmd}" "$@" > /dev/null 2>& 1 &
setsid "${dir}/${cmd}" "$@" >/dev/null 2>&1 &
echo "$!"
)
exit 0
Expand Down
20 changes: 10 additions & 10 deletions bin/bwallet
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash
#!/usr/bin/env bash

rl=0
daemon=0

if ! type perl > /dev/null 2>& 1; then
if uname | grep -i 'darwin' > /dev/null; then
echo 'Bcoin requires perl to start on OSX.' >& 2
if ! type perl >/dev/null 2>&1; then
if uname | grep -i 'darwin' >/dev/null; then
echo 'Bcoin requires perl to start on OSX.' >&2
exit 1
fi
rl=1
Expand All @@ -21,31 +21,31 @@ fi

dir=$(dirname "$file")

if test x"$1" = x'cli'; then
if test "$1" = 'cli'; then
shift
exec "${dir}/cli" "wallet" "$@"
exit 1
fi

for arg in "$@"; do
case "$arg" in
--daemon)
daemon=1
--daemon)
daemon=1
;;
esac
done

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
(
"${dir}/wallet" "$@" > /dev/null 2>& 1 &
"${dir}/wallet" "$@" >/dev/null 2>&1 &
echo "$!"
)
exit 0
fi
(
setsid "${dir}/wallet" "$@" > /dev/null 2>& 1 &
setsid "${dir}/wallet" "$@" >/dev/null 2>&1 &
echo "$!"
)
exit 0
Expand Down
Loading