summaryrefslogtreecommitdiff
path: root/community/leafnode/leafnode.install
blob: eb942009ed470b55f5f729341630354f49db6637 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
post_install() {
  echo "-- Adding user 'news' and group 'news', chowning /var/spool/news"
  groupadd -K GID_MIN=5000 news &>/dev/null
  gid=`cat /etc/group | grep news | cut -d: -f 3`
  useradd -u $gid -g news -d /var/spool/news -s /bin/false news &>/dev/null
  chown -R root:news etc/leafnode

  # create dir if necessary
  if [ ! -d var/spool/news ]; then
    install -d -m 770 -o news -g news var/spool/news
  fi
}

post_remove() {
  echo "-- Removing user 'news' and group 'news', deleting spool directory"
  userdel news &>/dev/null
  groupdel news &>/dev/null
  rm -rf var/spool/news
}