File: postinst

package info (click to toggle)
systraq 0.0.20050213-4
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,376 kB
  • ctags: 3
  • sloc: sh: 719; makefile: 146
file content (103 lines) | stat: -rw-r--r-- 3,234 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#! /bin/sh
# postinst script for systraq

SYSTRAQUSER=systraq

if ! getent passwd $SYSTRAQUSER > /dev/null 2>&1; then
	# echo "Adding systraq user..."
	adduser --system --disabled-password --home /var/lib/systraq \
		--quiet --group $SYSTRAQUSER
fi

#if ! grep -qi "^debian-systraq:" /etc/aliases; then
#	echo "debian-systraq: root" >> /etc/aliases
#	newal=`which newaliases`
#	if [ -x $newal ]; then
#		newaliases > /dev/null
#	fi
#fi

if ! test -d /var/lib/systraq; then
	cat <<EOT
You have a systraq user, but no /var/lib/systraq directory.
Your systraq user was not created by the systraq Debian package.
Please make sure your systraq user has /var/lib/systraq as its home
directory.  You can make this adjustment after this package is installed.
EOT
	mkdir -p /var/lib/systraq
fi

test -f /var/lib/systraq/.forward || echo root > /var/lib/systraq/.forward

# if [ "$2" = "" ]; then
	test -d /var/lib/systraq/filetraq || mkdir /var/lib/systraq/filetraq

	if ! getent group $SYSTRAQUSER > /dev/null 2>&1; then
		cat <<EOT
You do have a systraq user, but not a systraq group
on your system.  Your systraq user was not created by the systraq Debian package.
Please make sure your systraq user is a member of the systraq group.  You can
make this adjustment after this package is installed.
EOT
		addgroup --system --quiet $SYSTRAQUSER
        fi

	chown -R $SYSTRAQUSER:$SYSTRAQUSER /var/lib/systraq
# fi

#ftraqconf="/etc/systraq/filetraq.conf"
#if ! [ -e $ftraqconf ]; then
#	# creating default filetraq.conf
#	find /etc -perm a+r -type f | sort > $ftraqconf
#	ls -l /home/*/.ssh/a* | sort >> $ftraqconf
#	cat >> $ftraqconf <<-EOF
#		/var/lib/systraq/snapshot_pub.list
#		/var/lib/systraq/snapshot_pub.homelist
#		/var/lib/systraq/snapshot_root.list
#		/var/lib/systraq/snapshot_root.homelist
#		/var/lib/systraq/filetraq.conf
#		#
#		/var/lib/systraq/snapshot_pub.stat
#		/var/lib/systraq/snapshot_root.stat
#		/var/lib/systraq/systraq.md5sums
#	EOF
#fi

# Is systraq configured ?

if ! test -f /etc/systraq/snapshot_pub.list; then
    cat <<EOT > /etc/systraq/systraq_is_unconfigured
You are probably reading this file since you got it in your mailbox
by a cronjob.  Welcome!

There are 4 different ways to get rid of this somewhat annoying hourly
message from cron:

1) RTFM and configure systraq.  Systraq documentation is likely installed
   in a location like /usr/share/doc/systraq/ .  Remove the file
   systraq_is_unconfigured (probably in /etc/systraq/) when done.
2) Purge the systraq package from your system.
3) If systraq was installed from a package for your distribution, your
   package maintainer might have supplied configuration files, specifically
   tweaked for your system.  These are likely installed in
   /usr/share/doc/systraq/examples/<distributionname>/
   snapshot_{pub,root}.{home,}list .  Copy these to /etc/systraq/ .  Remove
   the file systraq_is_unconfigured (probably in /etc/systraq/) when done.
4) Execute
    # touch /etc/systraq/i_want_a_broken_systraq
   (proper location could vary).

# $Id: systraq_is_unconfigured 211 2005-02-12 20:39:39Z joostvb $
EOT

fi


# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0