summarylogtreecommitdiffstats
path: root/wwwoffle.install
blob: a70c8cd98f682fdc9c353489ec49b74fe5a33370 (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
64
65
66
67
68
69
70
71
72
post_install() {
  post_upgrade
}

post_upgrade() {
  echo "WWWOFFLE post-installation/ post-upgrade information, please read:"
  echo "-------------------"
  echo ""
  echo "If you upgraded from a version below 2.9j+svn2227-5,"
  echo "MANUAL INTERVENTION is required:"
  echo "Format of /etc/conf.d/wwwoffle changed between version"
  echo "2.9j+svn2227-4 and v2.9j+svn2227-5."
  echo "If you upgraded from a version below 2.9j+svn2227-5, please make"
  echo "sure you edit /etc/conf.d/wwwoffle."
  echo "The old variable 'WWWOFFLE_ARGS' is no longer understood. Instead,"
  echo "the place of the config file to use goes into 'WWWOFFLE_CONFIG_FILE',"
  echo "and further arguments to be passed to the deamon upon startup go into"
  echo "WWWOFFLED_EXTRA_ARGS."
  echo ""
  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
    echo ">>> Adding user wwwoffle."
    useradd -g wwwoffle wwwoffle
  fi
  echo ">>> Changing ownership of /var/spool/wwwoffle to wwwoffle:wwwoffle (recursively)."
  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
}