summarylogtreecommitdiffstats
path: root/counterwallet.install
blob: d6a53c79a71b788f7da01b9f444667076d5c02d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
post_install() {
  _mkuser
  chown -R counterwallet:counterwallet /etc/counterwallet /srv/http/counterwallet
  printf "%b\n" "$counterwallet"
}

post_upgrade() {
  post_install
}

post_remove() {
  _rmuser
  rm -rf /etc/counterwallet /srv/http/counterwallet
}

_mkuser() {
  getent passwd counterwallet &>/dev/null || {
    echo -n "Creating counterwallet user... "
    grep -E "^counterwallet:" /etc/group >/dev/null || groupadd counterwallet
    useradd -m -d /etc/counterwallet -g counterwallet -s /usr/bin/nologin counterwallet
    echo "done"
  }
}

_rmuser() {
  echo -n "Removing counterwallet user... "
  userdel -rf counterwallet 2>/dev/null
  echo "done"
}

read -d '' counterwallet <<'EOF'
Counterwallet
=============

Create a counterwallet.conf / counterwallet.testnet.conf file in the
counterblock config directory:

  $ cat > ~/.config/counterblock/counterwallet.conf <<'EOF'
  [Default]
  support-email=<your support email>
EOF