File: init.d.gentoo

package info (click to toggle)
mpdscribble 0.2.12-12
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 1,052 kB
  • ctags: 563
  • sloc: sh: 10,603; ansic: 4,277; makefile: 83
file content (30 lines) | stat: -rw-r--r-- 861 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
27
28
29
30
#!/sbin/runscript

depend() {
	need localmount
	need net
}

checkconfig() {
	if [ ! -f /etc/mpdscribble/mpdscribble.conf ]; then
	eerror "mpdscribble configuration file /etc/mpdscribble/mpdscribble.conf doesn't exist"
	eerror "run \"ebuild /var/db/pkg/net-misc/mpdscribble-<your-version>/mpdscribble-<your-version>.ebuild config\""
	eerror "to create a new config file."
		return 1
	fi
}

start () {
	checkconfig || return 1
	
	ebegin "Starting Music Player Daemon Audioscrobbler Client: mpdscribble"
	start-stop-daemon --start -p /var/run/mpdscribble.pid -b -m --exec /usr/bin/mpdscribble
	eend $?
}

stop () {
	ebegin "Stopping Music Player Daemon Audioscrobbler Client: mpdscribble"
	start-stop-daemon --stop --quiet -p /var/run/mpdscribble.pid -m --exec /usr/bin/mpdscribble || eerror "mpdscribble is not running"
	rm -f /var/run/mpdscribble.pid
	eend $?
}