File: init.d.gentoo

package info (click to toggle)
mpdscribble 0.25-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 968 kB
  • sloc: cpp: 3,803; sh: 164; makefile: 17
file content (32 lines) | stat: -rw-r--r-- 889 bytes parent folder | download | duplicates (2)
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
#!/sbin/runscript

depend() {
	need ntp-client
	need ntpd
	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 $?
}