mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-28 21:12:29 +02:00
Merge #21111: Improve OpenRC initscript
95f97111dd
contrib/init: (OpenRC) quote some unquoted variables. (parazyd)737feadff7
contrib/init: (OpenRC) Do not fail if both rpcuser and rpcpassword are unset. (parazyd) Pull request description: This pull request improves the available OpenRC initscripts in `contrib/init`. The first commit (737feadff7
) reworks `checkconfig()` to not fail if **both** `rpcuser` and `rpcpassword` are unset, because this implies that bitcoind shall use the `.cookie` file for RPC authentication. Currently, the initscript does not allow starting bitcoind without a set `rpcuser` and `rpcpassword`. The second commit (95f97111dd
) simply quotes some unquoted variables. ACKs for top commit: kristapsk: ACK95f97111dd
Tree-SHA512: 62bebcd07143c147e349c0cfc17b54ef21bd4684377b444f58c6bd1f509a4d3e1af58746fa7215f18e33021f691bbbc5e42f4df497458322b055e545b7f30d46
This commit is contained in:
commit
3c631917f3
@ -60,16 +60,17 @@ start_pre() {
|
|||||||
"${BITCOIND_PIDDIR}"
|
"${BITCOIND_PIDDIR}"
|
||||||
|
|
||||||
checkpath -f \
|
checkpath -f \
|
||||||
-o ${BITCOIND_USER}:${BITCOIND_GROUP} \
|
-o "${BITCOIND_USER}:${BITCOIND_GROUP}" \
|
||||||
-m 0660 \
|
-m 0660 \
|
||||||
${BITCOIND_CONFIGFILE}
|
"${BITCOIND_CONFIGFILE}"
|
||||||
|
|
||||||
checkconfig || return 1
|
checkconfig || return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
checkconfig()
|
checkconfig()
|
||||||
{
|
{
|
||||||
if ! grep -qs '^rpcpassword=' "${BITCOIND_CONFIGFILE}" ; then
|
if grep -qs '^rpcuser=' "${BITCOIND_CONFIGFILE}" && \
|
||||||
|
! grep -qs '^rpcpassword=' "${BITCOIND_CONFIGFILE}" ; then
|
||||||
eerror ""
|
eerror ""
|
||||||
eerror "ERROR: You must set a secure rpcpassword to run bitcoind."
|
eerror "ERROR: You must set a secure rpcpassword to run bitcoind."
|
||||||
eerror "The setting must appear in ${BITCOIND_CONFIGFILE}"
|
eerror "The setting must appear in ${BITCOIND_CONFIGFILE}"
|
||||||
|
Loading…
Reference in New Issue
Block a user