summarylogtreecommitdiffstats
path: root/adsuck.install
blob: 9bd86c243cd001f04fd5d488cbaf154aa01fd290 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#! /bin/bash

post_install() {
  if [ ! `egrep '^_adsuck:' /etc/group` ]; then
    echo "Adding adsuck group"
    groupadd _adsuck
  fi

  if [ ! `egrep '^_adsuck:' /etc/passwd` ]; then
    echo "Adding adsuck user"
    useradd -g _adsuck -d /var/adsuck -s /bin/false _adsuck
  fi
  echo 'Now manipulate the regex file /var/adsuck/filter and get your /var/adsuck/hosts file'
  echo 'Examples: http://www.mvps.org/winhelp2002/hosts.txt'
  echo '          http://rlwpx.free.fr/WPFF/hosts.htm'
  echo '          http://pgl.yoyo.org/adservers/serverlist.php?showintro=0;hostformat=hosts'
  echo 'And make sure your setup with resolv.conf is correct.'
}

post_upgrade() {
  post_install $1
}

pre_remove() {
  echo "Removing adsuck user and group"
  groupdel _adsuck &> /dev/null
  userdel _adsuck &> /dev/null
}

op=$1
shift

$op $*