summarylogtreecommitdiffstats
path: root/wwwoffle.install
blob: 731f05aa699399a3224da77d429cc5bc83b883f0 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
post_install() {
  post_upgrade
}

post_upgrade() {
  echo "ATTENTION WWWOFFLE:"
  echo "-------------------"
  echo ""
  echo "Configuration file template is installed at"
  echo "  /etc/wwwoffle/wwwoffle.conf.template"
  echo ""
  echo "Copy it to /etc/wwwoffle/wwwoffle.conf and edit it to your needs"
  echo "in order to make wwwoffle work."
  echo ""
  echo "-------------------"
  echo ""
  echo "init-scripts were installed for:"
  echo "  * sysvinit ('/etc/rc.d/wwwoffle'),"
  echo "  * openrc ('/etc/init.d/wwwoffle') and"
  echo "  * systemd ('/usr/lib/systemd/system/wwwoffle.service')."
  echo "Which one will be used depends on your init system you use."
  echo ""
  echo "Also, if you want to run wwwoffled at boot, you need to enable the"
  echo "service the way it is applicable for your initsystem. By default"
  echo "it won't be launched at bootup."
  echo ""
  echo "-------------------"
  echo ""
  echo "In order to define the options passed to wwwoffle during startup"
  echo "(including which configuration file to use), edit"
  echo "  * the file '/etc/conf.d/wwwoffle' when using"
  echo "    - sysvinit or"
  echo "    - openrc,"
  echo "  * the file '/usr/lib/systemd/system/wwwoffle.service' when using"
  echo "    systemd."
  echo ""
  echo "-------------------"
  echo ""
  echo "Set bind-ipv4 = none in wwwoffle.conf if you get ipv4 related warnings."
  echo ""
  echo "-------------------"
  if [ ! `grep -E '^wwwoffle\:' /etc/group` ]; then
    echo ">>> Adding group wwwoffle."
    groupadd wwwoffle &> /dev/null
  fi
  if [ ! `grep -E '^wwwoffle\:' /etc/passwd` ]; then
  id wwwoffle &> /dev/null || \
    echo ">>> Adding user wwwoffle."
    useradd -g wwwoffle wwwoffle
  fi
  chown -R wwwoffle:wwwoffle /var/spool/wwwoffle
}

pre_remove() {
  echo ">>> Removing user wwwoffle."
  userdel wwwoffle &> /dev/null
  echo ">>> Removing group wwwoffle."
  groupdel wwwoffle &> /dev/null
}

op=$1
shift
$op $*