File: postinst-init-scripts

package info (click to toggle)
jailer 0.4-9%2Betch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 364 kB
  • ctags: 6
  • sloc: sh: 2,598; perl: 207; makefile: 48
file content (60 lines) | stat: -rw-r--r-- 1,135 bytes parent folder | download | duplicates (5)
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
#!/bin/sh

set -e


#DEBHELPER#
exit 0



echo "Jailer contains pre-defined jails for BIND and for NTP."
echo ""
echo -n "Add BIND jail?[Y/n] "
read yn
test -n "$yn" || yn="Y"

case "$yn" in
	[Nn]*)
		echo "BIND jail not configured automaticly!"
		echo -n "Press [ENTER] "
		read line
		;;
	*)
		if ! $(dpkg-divert --list /etc/init.d/bind.jailer | grep -q "by jailer"); then
		    dpkg-divert --package jailer --add --rename \
		        --divert /etc/init.d/bind.jailer /etc/init.d/bind
		fi

		/usr/sbin/jailer.pl /etc/jailer.conf bind

		update-rc.d jail-bind defaults >/dev/null
		/etc/init.d/jail-bind start

		;;
esac

echo ""
echo -n "Add NTP jail?[Y/n] "
read yn
test -n "$yn" || yn="Y"

case "$yn" in
	[Nn]*)
		echo "BIND jail not configured automaticly!"
		echo -n "Press [ENTER] "
		read line
		;;
	*)
		if ! $(dpkg-divert --list /etc/init.d/ntp.jailer | grep -q "by jailer"); then
		    dpkg-divert --package jailer --add --rename \
  		      --divert /etc/init.d/ntp.jailer /etc/init.d/ntp
		fi

		/usr/sbin/jailer.pl /etc/jailer.conf ntp

		update-rc.d jail-ntp defaults >/dev/null
		/etc/init.d/jail-ntp start

		;;
esac