Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 91 lines (72 sloc) 2.559 kb
b31a690 Jon Jensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
1 #! /bin/sh
2 #
3 # Copyright 2001 by Stefan Hornburg (Racke) <racke@linuxia.de>
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public
16 # License along with this program; if not, write to the Free
17 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
18 # MA 02111-1307 USA.
19
20 # Source debconf library
21 . /usr/share/debconf/confmodule
22
23 # Get interchange user and group
24 db_get interchange/user
25 USER=$RET
26 db_get interchange/group
27 GROUP=$RET
28
29 # Creating interchange group if he isn't already there
30 if ! grep -q ^$GROUP: /etc/group; then
31 echo Adding system group: $GROUP.
32 addgroup $GROUP
33 fi
34
35 # Creating interchange user if he isn't already there
36 if ! grep -q ^$USER: /etc/passwd; then
37 echo Adding system user: $USER.
38 adduser --system --ingroup $GROUP --home /usr/lib/interchange $USER
39 fi
40
41 # Ensure correct permissions for directories with log files resp. PID file
42 chown -R $USER.$GROUP /var/log/interchange
43 chmod 770 /var/log/interchange
44 chown -R $USER.$GROUP /var/run/interchange
45 chown -R $USER.$GROUP /usr/lib/cgi-bin/ic
46 chmod u+s /usr/lib/cgi-bin/ic/*
47
48 # Ensure correct permissions for catalog base directory
49 chown $USER.$GROUP /var/lib/interchange/catalogs
50
51 # Make makecat.cfg accessible for the interchange user
52 chown $USER.$GROUP /etc/interchange/makecat.cfg
53
54 # Record debconf configuration in two files
55 # 1. Stuff needed for the init script
56
57 INITCFG=/etc/interchange/init.cfg
58 cat > $INITCFG <<EOF
59 # This file is automatically generated !
60 #
61 # YOU MAY MODIFY THIS FILE
62 # But we recommend to use dpkg-reconfigure interchange instead.
63
64 EOF
65
66 db_get interchange/mode
67 case "$RET" in
68 "unix mode") MODE=--unix;;
69 "internet mode") MODE=--inetmode;;
70 "both") MODE="";;
71 esac
72 echo MODE=$MODE >> $INITCFG
73 echo USER=$USER >> $INITCFG
74 echo GROUP=$GROUP >> $INITCFG
75
76 db_get interchange/docroot
77 echo DOCROOT=$RET >> $INITCFG
78
79 # 2. Settings which influence the global configuration
80 # and make senses to be configured by debconf
81
82 /usr/sbin/interchangeconfig
83
84 #DEBHELPER#
85
86 # Don't wait on Interchange to close file handles
87 db_stop
88
89 exit 0
90
Something went wrong with that request. Please try again.