diff options
author | Stuart Cardall <developer@it-offshore.co.uk> | 2017-03-13 05:31:23 +0000 |
---|---|---|
committer | Leonardo Arena <rnalrd@alpinelinux.org> | 2017-03-17 09:51:55 +0000 |
commit | 3597bb4ea3f53255b366bec278b266dee2827fa4 (patch) | |
tree | 300cc6ae676196e5f1a4de64dc36df73aa28b2a1 /community/bitcoin/bitcoin.post-install | |
parent | 202c1da50d05709af2b26dcb63bb433f562950fb (diff) | |
download | aports-3597bb4ea3f53255b366bec278b266dee2827fa4.tar.bz2 aports-3597bb4ea3f53255b366bec278b266dee2827fa4.tar.xz |
community/bitcoin: update to 0.14.0 / use supervise-daemon
https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.14.0.md
initd now uses supervise-daemon for service supervision.
please note the new bitcoin.conf format => do NOT enable daemon mode
as supervise-daemon requires services to run in the foreground.
Diffstat (limited to 'community/bitcoin/bitcoin.post-install')
-rw-r--r-- | community/bitcoin/bitcoin.post-install | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/community/bitcoin/bitcoin.post-install b/community/bitcoin/bitcoin.post-install index 9d2510fb2d..42cb50cac2 100644 --- a/community/bitcoin/bitcoin.post-install +++ b/community/bitcoin/bitcoin.post-install @@ -4,7 +4,7 @@ NORMAL="\033[1;0m" STRONG="\033[1;1m" GREEN="\033[1;32m" -config=$(grep -F 'config=' /etc/init.d/bitcoin |sed 's/config=//') +config=$(find /etc -maxdepth 1 -type f -name bitcoin.conf*) randgen() { output=$(cat /dev/urandom | tr -dc '0-9a-zA-Z!@#$%^&*_+-' | head -c${1:-$1}) 2>/dev/null @@ -17,19 +17,21 @@ findRandomTcpPort(){ } GenPasswd(){ - sed -i "/rpcuser=/ c \rpcuser=USER-"$(randgen 32)"" $config - sed -i "/rpcpassword=/ c \rpcpassword=PW-"$(randgen 64)"" $config - sed -i "/rpcport=/ c \rpcport="$(findRandomTcpPort)"" $config - print_green "Generated random user / password / port in:" " $config\n" + sed -i "/rpcuser=/ c \rpcuser=USER-"$(randgen 32)"" $1 + sed -i "/rpcpassword=/ c \rpcpassword=PW-"$(randgen 64)"" $1 + sed -i "/rpcport=/ c \rpcport="$(findRandomTcpPort)"" $1 + print_green "Generated random user / password / port in:" " $1\n" } print_green() { - local prompt="${STRONG}$1${GREEN}$2${NORMAL}" - printf "${prompt}%s" + local prompt="${STRONG}$1${GREEN}$2${NORMAL}" + printf "${prompt}%s" } -if grep -F "changeme" $config 1>/dev/null; then - GenPasswd -fi +for file in $config; do + if grep -F "changeme" $file 1>/dev/null; then + GenPasswd $file + fi +done exit 0 |