Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 132 lines (108 sloc) 3.405 kB
b31a690 @jonjensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
1 #! /bin/sh
2 #
a350a51 @racke directory designed for adding/removing catalogs from packages introduced
racke authored
3 # Copyright 2001,2002 by Stefan Hornburg (Racke) <racke@linuxia.de>
b31a690 @jonjensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
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
34b7fac @racke merged changes 2.6 vs 2.6.2.1
racke authored
49 # and static HTML base directory
50
b31a690 @jonjensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
51 chown $USER.$GROUP /var/lib/interchange/catalogs
34b7fac @racke merged changes 2.6 vs 2.6.2.1
racke authored
52 db_get interchange/docroot
4227902 @racke merged changes 2.6.2.1 vs 2.6.2.2
racke authored
53 if [ -d "$RET" ]; then
54 chown $USER.$GROUP "$RET"
55 fi
b31a690 @jonjensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
56
7457617 @racke merged changes 2.6.2.2 vs 2.6.2.3
racke authored
57 # More permissions
58
59 chown -R $USER.$GROUP /etc/interchange/usertag
a350a51 @racke directory designed for adding/removing catalogs from packages introduced
racke authored
60 chown -R $USER.$GROUP /var/lib/interchange/catalog.d
7457617 @racke merged changes 2.6.2.2 vs 2.6.2.3
racke authored
61
3a10e17 @racke comment improved
racke authored
62 # Record debconf configuration in multiple files
b31a690 @jonjensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
63 # 1. Stuff needed for the init script
64
65 INITCFG=/etc/interchange/init.cfg
66 cat > $INITCFG <<EOF
67 # This file is automatically generated !
68 #
69 # YOU MAY MODIFY THIS FILE
70 # But we recommend to use dpkg-reconfigure interchange instead.
71
72 EOF
73
74 db_get interchange/mode
75 case "$RET" in
76 "unix mode") MODE=--unix;;
77 "internet mode") MODE=--inetmode;;
78 "both") MODE="";;
79 esac
80 echo MODE=$MODE >> $INITCFG
81 echo USER=$USER >> $INITCFG
82 echo GROUP=$GROUP >> $INITCFG
83
84 db_get interchange/docroot
85 echo DOCROOT=$RET >> $INITCFG
86
fd79b4d @racke Debian packages support the selection of the GnuPG home directory
racke authored
87 db_get interchange/gpghome
88 echo GPGHOME=$GPGHOME >> $INITCFG
89
b31a690 @jonjensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
90 # 2. Settings which influence the global configuration
91 # and make senses to be configured by debconf
92
57f92e5 @racke pass debconf settings
racke authored
93 db_get interchange/debug
15f3e33 @racke translate true/false
racke authored
94 if [ "$RET" = true ]; then
95 DEBUG=1
96 else
97 DEBUG=0
98 fi
2d38b94 @racke Default traffic setting is low now.
racke authored
99 db_get interchange/traffic
100 TRAFFIC="$RET"
101 /usr/sbin/interchangeconfig DEBUG=$DEBUG TRAFFIC=$RET
b31a690 @jonjensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
102
ec0e042 @racke recommit of changes put into the old branch
racke authored
103 # Make configuration files owned by the interchange user
104 chown -R $USER.$GROUP /etc/interchange
105
3485ca0 @racke work in progress
racke authored
106 # Check if we delay the startup
ef1be7f @racke restart server only once if both interchange and interchange-ui
racke authored
107 if [ -f /var/run/interchange-install ]; then
108 PACKAGES=""
109 exec 4</var/run/interchange-install
110 while read <&4 PKG; do
111 if [ ! "$PKG" = "interchange" ]; then
112 PACKAGES="$PKG $PACKAGES"
113 fi
114 done
115 if [ -z "$PACKAGES" ]; then
116 rm /var/run/interchange-install
117 else
118 exec 5>/var/run/interchange-install
119 for PKG in $PACKAGES; do
120 echo "$PKG" >&5
121 done
122 fi
123 fi
3485ca0 @racke work in progress
racke authored
124
b31a690 @jonjensen Move DEV_4_7_0 development branch to repository trunk.
jonjensen authored
125 #DEBHELPER#
126
127 # Don't wait on Interchange to close file handles
128 db_stop
129
130 exit 0
131
Something went wrong with that request. Please try again.