summaryrefslogtreecommitdiff
path: root/community/partimage/partimage.install
blob: 4d403b177b59e40e4102aa5b7ac56bb4a265dbe9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
pre_install() {
  groupadd -g 110 partimag &> /dev/null
  useradd -u 110 -g partimag -c "Partimage user" -d /dev/null -s /bin/false partimag &> /dev/null
}

post_install() {
  chown partimag:partimag /etc/partimaged/partimagedusers
}

post_upgrade() {
  if [ "$(getent group partimag | cut -d ':' -f 3)" != '110'  ]; then
    post_remove
    pre_install
    echo ">> partimage UID/GID has been changed"
    echo ">> if you have some directories owned by partimage - please chown them again"
  fi
}

post_remove() {
  userdel partimag > /dev/null
  groupdel partimag > /dev/null
}