aboutsummaryrefslogtreecommitdiffstats
path: root/todo/putback
blob: 00ec1e4d96b2fc7ec0c10bf84568e1e7b47d9c06 (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
#! /bin/sh
#
# System stop script for putback 
#
### BEGIN INIT INFO
# Provides: putback
# Default-Start:  %
# Default-Stop:   3 5
# Description:    Puts back media from jukebox
### END INIT INFO

# Source SuSE config
. /etc/rc.config

# Determine the base and follow a runlevel link name.
base=${0##*/}
link=${base#*[SK][0-9][0-9]}

# Force execution if not called by a runlevel directory.
test $link = $base && PUTBACK_MEDIA=yes
test "$PUTBACK_MEDIA" = yes || exit 0

PUTBACK_BIN=/usr/sbin/putback
test -x $FOO_BIN || exit 5

. /etc/rc.status

# First reset status of this service
rc_reset

case "$1" in
    stop)
	echo -n "Putting back media"
	$PUTBACK_BIN
	rc_status -v
	;;
    *)
	echo -n "Putback is only useful when shutting down"
	rc_status -v
	;;
esac
rc_exit