aboutsummaryrefslogtreecommitdiff
blob: a8507825c110c5856594f6c4e85c1d12eb42c067 (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
#!/bin/sh
# $Id: vdrshutdown-gate.sh 625 2008-07-06 12:59:34Z zzam $
# Author:
#   Matthias Schwarzott <zzam@gmx.de>
#   Various other contributors from gentoo.de
#
# You have to edit sudo-permissions to grant vdr permission to execute
# privileged commands. Start visudo and add a line like
#   vdr     ALL= NOPASSWD: /usr/share/vdr/bin/vdrshutdown-really.sh

include svdrpcmd
svdrp_command

#fork to background
if [ -z "${EXECUTED_BY_VDR_BG}" ]; then
	exec /usr/share/vdr/bin/vdr-bg.sh "$0" "$@"
	exit
fi

mesg() {
	"${SVDRPCMD}" MESG "$@"
}

sudo /usr/share/vdr/bin/vdrshutdown-really.sh "$@"

[ $? = 1 ] && mesg "sudo failed: call emerge --config gentoo-vdr-scripts"

exit 0