summaryrefslogtreecommitdiff
path: root/testing/memcached/memcached.install
blob: 6009b713fdd886616f11af2a5f720f86785b3c44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
post_install() {
  if ! getent group memcached >/dev/null; then
    groupadd --system memcached
  fi
  if ! getent passwd memcached >/dev/null; then
    useradd --system -c 'memcached user' -g memcached -d / -s /bin/bash memcached
    passwd -l memcached >/dev/null
  fi
}

post_upgrade() {
  post_install $1
}

post_remove() {
  if getent passwd memcached >/dev/null; then
    userdel memcached
  fi
  if getent group memcached >/dev/null; then
    groupdel memcached
  fi
}