Line | |
---|
1 | #! /bin/sh
|
---|
2 |
|
---|
3 | name=`./samhain-install.sh --print-config name`
|
---|
4 | sbin=`./samhain-install.sh --print-config sbin_dir`
|
---|
5 | rcfi=`./samhain-install.sh --print-config config_file`
|
---|
6 | passwd=$1
|
---|
7 |
|
---|
8 | setpwd="./${name}_setpwd"
|
---|
9 |
|
---|
10 | # Install the prepared configuration file.
|
---|
11 | #
|
---|
12 | test -f ./prepared_samhainrc || exit 1
|
---|
13 | ./samhain-install.sh --install-sh -m 600 ./prepared_samhainrc "$rcfi" || exit 1
|
---|
14 |
|
---|
15 | # Gentoo noise
|
---|
16 | #
|
---|
17 | rm -f /etc/init.d/._cfg????_${name}
|
---|
18 | rm -f /etc/._cfg????_${name}rc
|
---|
19 |
|
---|
20 | # Set the password within the executable.
|
---|
21 | #
|
---|
22 | if test "x${passwd}" = "xDUMMY"
|
---|
23 | then
|
---|
24 | rm -f "$sbin/${name}_setpwd"
|
---|
25 | else
|
---|
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"
|
---|
36 | fi
|
---|
37 |
|
---|
38 | exit 0
|
---|
39 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.