source: trunk/dsys/postinstall@ 3

Last change on this file since 3 was 1, checked in by katerina, 19 years ago

Initial import

File size: 827 bytes
Line 
1#! /bin/sh
2
3name=`./samhain-install.sh --print-config name`
4sbin=`./samhain-install.sh --print-config sbin_dir`
5rcfi=`./samhain-install.sh --print-config config_file`
6passwd=$1
7
8setpwd="./${name}_setpwd"
9
10# Install the prepared configuration file.
11#
12test -f ./prepared_samhainrc || exit 1
13./samhain-install.sh --install-sh -m 600 ./prepared_samhainrc "$rcfi" || exit 1
14
15# Gentoo noise
16#
17rm -f /etc/init.d/._cfg????_${name}
18rm -f /etc/._cfg????_${name}rc
19
20# Set the password within the executable.
21#
22if test "x${passwd}" = "xDUMMY"
23then
24 rm -f "$sbin/${name}_setpwd"
25else
26 current=`pwd`
27 cd "$sbin" || exit 1
28 eval "$setpwd" "$name" new "$passwd" || exit 1
29 if test -f "${name}.new"
30 then
31 rm "$name" || exit 1
32 mv "${name}.new" "$name" || exit 1
33 rm -f "./${name}_setpwd"
34 fi
35 cd "$current"
36fi
37
38exit 0
39
Note: See TracBrowser for help on using the repository browser.