diff options
author | TomZ | 2017-11-09 20:29:18 +0100 |
---|---|---|
committer | TomZ | 2017-11-09 20:43:39 +0100 |
commit | 032a4ff8e6bc4a2f8723261f57d59dbdceaca6ad (patch) | |
tree | 5b4612be438bb0eead82a573e0014e192664eff0 /bitcoin.install | |
parent | 1852dc6e90354bebe2eba904cc4ce9917940bcad (diff) | |
download | aur-bitcoin-classic-git.tar.gz |
update
Diffstat (limited to 'bitcoin.install')
-rw-r--r-- | bitcoin.install | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/bitcoin.install b/bitcoin.install deleted file mode 100644 index a42cd1eea7e8..000000000000 --- a/bitcoin.install +++ /dev/null @@ -1,50 +0,0 @@ -_bc_user=bitcoin -_bc_group=bitcoin - -post_install() { - _mkuser - _dir="/var/lib/bitcoind" - _cnf="/etc/bitcoin" - if test ! -d "$_dir"; then - mkdir -m 750 "$_dir" - # disable Copy-On-Write (btrfs directories only) - # This avoids lots of known db-corruption issues - _is_btrfs "$_dir" && chattr +C "$_dir" - fi - chown -R $_bc_user:$_bc_group "$_dir" "$_cnf" - chmod 775 "$_cnf" - printf "%b\n" "$bitcoin" -} - -post_upgrade() { - _mkuser - printf "%b\n" "$bitcoin" -} - - -# ------------------------------------------------------------------------------ -# helper functions for creating bitcoin user / group -# ------------------------------------------------------------------------------ - -_mkuser() { - getent passwd $_bc_user &>/dev/null || { - echo -n "Creating bitcoin user... " - grep -E "^$_bc_group:" /etc/group >/dev/null || groupadd $_bc_group - useradd -m -d /etc/bitcoin -g $_bc_group -s /usr/bin/nologin $_bc_user 2>/dev/null - echo "done" - } -} - -# ------------------------------------------------------------------------------ -# helper functions for disabling btrfs Copy-On-Write (CoW) -# https://wiki.archlinux.org/index.php/Btrfs#Copy-On-Write_.28CoW.29 -# ------------------------------------------------------------------------------ - -# check if dir is btrfs -_is_btrfs() { - if [[ $(findmnt --target $1 --output FSTYPE --noheadings) == 'btrfs' ]]; then - return 0 - else - return 1 - fi -} |