Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

91 lines (72 sloc) 2.552 kb
#! /bin/sh
#
# Copyright 2001 by Stefan Hornburg (Racke) <racke@linuxia.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA.
# Source debconf library
. /usr/share/debconf/confmodule
# Get interchange user and group
db_get interchange/user
USER=$RET
db_get interchange/group
GROUP=$RET
# Creating interchange group if he isn't already there
if ! grep -q ^$GROUP: /etc/group; then
echo Adding system group: $GROUP.
addgroup $GROUP
fi
# Creating interchange user if he isn't already there
if ! grep -q ^$USER: /etc/passwd; then
echo Adding system user: $USER.
adduser --system --ingroup $GROUP --home /usr/lib/interchange $USER
fi
# Ensure correct permissions for directories with log files resp. PID file
chown -R $USER.$GROUP /var/log/interchange
chmod 770 /var/log/interchange
chown -R $USER.$GROUP /var/run/interchange
chown -R $USER.$GROUP /usr/lib/cgi-bin/ic
chmod u+s /usr/lib/cgi-bin/ic/*
# Ensure correct permissions for catalog base directory
chown $USER.$GROUP /var/lib/interchange/catalogs
# Record debconf configuration in two files
# 1. Stuff needed for the init script
INITCFG=/etc/interchange/init.cfg
cat > $INITCFG <<EOF
# This file is automatically generated !
#
# YOU MAY MODIFY THIS FILE
# But we recommend to use dpkg-reconfigure interchange instead.
EOF
db_get interchange/mode
case "$RET" in
"unix mode") MODE=--unix;;
"internet mode") MODE=--inetmode;;
"both") MODE="";;
esac
echo MODE=$MODE >> $INITCFG
echo USER=$USER >> $INITCFG
echo GROUP=$GROUP >> $INITCFG
db_get interchange/docroot
echo DOCROOT=$RET >> $INITCFG
# 2. Settings which influence the global configuration
# and make senses to be configured by debconf
/usr/sbin/interchangeconfig
# Make configuration files owned by the interchange user
chown -R $USER.$GROUP /etc/interchange
#DEBHELPER#
# Don't wait on Interchange to close file handles
db_stop
exit 0
Jump to Line
Something went wrong with that request. Please try again.