aboutsummaryrefslogtreecommitdiff
blob: 8d7ccf1aea99ce1e76479e608249555e391a06ab (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
#!/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

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

svdrp_command

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

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

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

exit 0