#!/bin/bash # I, Ian Kelling, follow the GNU license recommendations at # https://www.gnu.org/licenses/license-recommendations.en.html. They # recommend that small programs, < 300 lines, be licensed under the # Apache License 2.0. This file contains or is part of one or more small # programs. If a small program grows beyond 300 lines, I plan to switch # its license to GPL. # Copyright 2024 Ian Kelling # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ## bitcoin disabled. fees too high if [[ $HOSTNAME == frodo ]]; then case $distro in debian) if [[ `debian-archive` == testing ]]; then # has no unstable dependencies pi bitcoind/unstable src=/a/opt/bitcoin/contrib/init/bitcoind.service s cp $src /etc/systemd/system p=/etc/bitcoin/bitcoin dst=/etc/systemd/system/bitcoinjm.service # jm for joinmarket $sed -r "/^\s*ExecStart/s,${p}.conf,${p}jm.conf," $src \ >/etc/systemd/system/bitcoinjm.service d=jm; jm=d # being clever for succinctness for s in d jm; do s $sed -ri "/^\s*\[Unit\]/a Conflicts=bitcoin${!s}.service" \ /etc/systemd/system/bitcoin${s}.service done ser daemon-reload dir=/nocow/.bitcoin s mkdir -p $dir s chown -R bitcoin:bitcoin $dir dir=/etc/bitcoin s mkdir -p $dir s chown -R root:bitcoin $dir s chmod 750 $dir # pruning decreases the bitcoin dir to 2 gb, keeps # just the recent blocks. can\'t do a few things like # import a wallet dump. # pruning works, but people had to do # some manual stuff in joinmarket. I dun need the # disk space, so not bothering yet, maybe in a year or so. # https://github.com/JoinMarket-Org/joinmarket/issues/431 #https://bitcoin.org/en/release/v0.12.0#wallet-pruning #prune=550 f=$dir/bitcoin.conf s dd of=$f </dev/null <