source: trunk/dsys/postinstall@ 225

Last change on this file since 225 was 27, checked in by rainer, 19 years ago

Support for server-to-server relay and more user policies

File size: 1.5 KB
Line 
1#! /bin/sh
2
3#
4# Copyright Rainer Wichmann (2005)
5#
6# License Information:
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, write to the Free Software
19# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20#
21
22name=`./samhain-install.sh --print-config name`
23sbin=`./samhain-install.sh --print-config sbin_dir`
24rcfi=`./samhain-install.sh --print-config config_file`
25passwd=$1
26
27setpwd="./${name}_setpwd"
28
29# Install the prepared configuration file.
30#
31test -f ./prepared_samhainrc || exit 1
32./samhain-install.sh --install-sh -m 600 ./prepared_samhainrc "$rcfi" || exit 1
33
34# Gentoo noise
35#
36rm -f /etc/init.d/._cfg????_${name}
37rm -f /etc/._cfg????_${name}rc
38
39# Set the password within the executable.
40#
41if test "x${passwd}" = "xDUMMY"
42then
43 rm -f "$sbin/${name}_setpwd"
44else
45 current=`pwd`
46 cd "$sbin" || exit 1
47 eval "$setpwd" "$name" new "$passwd" || exit 1
48 if test -f "${name}.new"
49 then
50 rm "$name" || exit 1
51 mv "${name}.new" "$name" || exit 1
52 rm -f "./${name}_setpwd"
53 fi
54 cd "$current"
55fi
56
57exit 0
58
Note: See TracBrowser for help on using the repository browser.