File: postinst

package info (click to toggle)
cfingerd 1.3.2-11.0
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 600 kB
  • ctags: 396
  • sloc: ansic: 3,220; perl: 572; makefile: 155; sh: 52
file content (26 lines) | stat: -rw-r--r-- 820 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/perl
# post install script for the Debian GNU/Linux cfingerd package

require DebianNet;

open(INETD, "/etc/inetd.conf");
    @inetd=<INETD>;
close(INETD);

if (grep(/.*cfingerd.*/, @inetd)) {
    $DebianNet::sep = "## "; DebianNet::disable_service("finger", "in.fingerd");
    $DebianNet::sep = "#<off># "; DebianNet::enable_service("finger", "cfingerd");
} else {
    $DebianNet::sep = "## "; DebianNet::disable_service("finger", "in.fingerd");
    $fingentry = 'finger		stream	tcp	nowait	root	/usr/sbin/tcpd	/usr/sbin/cfingerd';
    $DebianNet::sep = "#<off># "; DebianNet::add_service($fingentry, "INFO");
}
undef(@inetd);

foreach $f ("uptime","ping") {
    if (-f "/etc/cfingerd/saved.$f") {
	system "mv -f /etc/cfingerd/saved.$f /etc/cfingerd/scripts/$f";
    }
}

system "/etc/init.d/netbase reload";