summaryrefslogtreecommitdiff
path: root/extra/oprofile/oprofile.install
blob: 025c9725ae14a09f848d013ad452b94ff27369d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
post_install(){
  groupadd -g 492 oprofile &>/dev/null
  useradd -u 492 -g oprofile -s /bin/false oprofile &>/dev/null
}

post_upgrade(){
  getent group oprofile >/dev/null 2>&1 || groupadd -g 492 oprofile &>/dev/null
  getent passwd oprofile >/dev/null 2>&1 || useradd -u 492 -g oprofile -s /bin/false oprofile &>/dev/null
}

post_remove(){
  if getent passwd oprofile >/dev/null 2>&1; then
    userdel oprofile
  fi
  if getent group oprofile >/dev/null 2>&1; then
    groupdel oprofile
  fi
}