summaryrefslogtreecommitdiff
blob: 2c902db8c7bb4915d8a9e19cec31c4689c3bed2f (plain)
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
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Author:  Brice Arnould
# Credits:  To all those I got ideas from :)
# 
# $Header: /var/cvsroot/gentoo-x86/net-dialup/penggy/files/rc_net.aol,v 1.2 2004/07/14 23:17:15 agriffis Exp $

# NB: Config is in /etc/penggy/

depend() {
	need modules net
}

checkconfig() {

	if [ ! -x /usr/sbin/penggy ]
	then
		eerror "Penggy needs to be installed"
		return 1
	fi

	if [ -e /var/run/penggy.pid -a "${FUNCT}" = "start" ]
	then
		eerror "Penggy is already started"
		return 1
	fi

	if [ ! -e /var/run/penggy.pid -a "${FUNCT}" = "stop" ]
	then
		eerror "Penggy is not started"
		return 1
	fi
						
}

start() {

	checkconfig || return 1
	ebegin "Connecting to the AOL/Compuserve network"
	/usr/sbin/penggy -r -d
	eend $? "Failed to etablish the connection"
}

stop() {

	checkconfig || return 1
	ebegin "Closing the connection to the AOL/Compuserve network"
	kill $(cat /var/run/penggy.pid)
	eend
}