summaryrefslogtreecommitdiffstats
path: root/abs/extra/dnsmasq/dnsmasq.install
blob: c2edb7db5017d6f747164b782ed9aa58cc09ae3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

add_dnsmasq_user() {
  if ! getent passwd dnsmasq >/dev/null; then
    useradd -r -d / -c 'dnsmasq daemon' -s /sbin/nologin dnsmasq
  fi
}

post_install() {
  add_dnsmasq_user
}

post_upgrade() {
  add_dnsmasq_user
}

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