summarylogtreecommitdiffstats
path: root/electroneum.install
blob: 8f35411306504f59549da5bf249d7b8860581973 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
create_user() {
  getent passwd electroneum &>/dev/null || {
    echo -n ">>> Creating electroneum user... "
    useradd --system --user-group -m --home /var/lib/electroneum electroneum
    echo "done"
  } # NOTE: we do not autoremove user due to security concerns (Arch policy)
  mkdir -p /var/log/electroneum && chown electroneum:electroneum /var/log/electroneum
  mkdir -p /var/lib/electroneum && chown electroneum:electroneum /var/lib/electroneum
}

post_install() {
  create_user
}

post_upgrade() {
  create_user
}