diff options
author | Matthias Schwarzott <zzam@gentoo.org> | 2008-06-17 20:11:08 +0000 |
---|---|---|
committer | Matthias Schwarzott <zzam@gentoo.org> | 2008-06-17 20:11:08 +0000 |
commit | c4e55754f75080f8d07e8e859f4caefdb6810d83 (patch) | |
tree | a1fb90c1bbb1ab588661fbb69e6142f9bda279e5 /etc | |
parent | No longer check old location for addons and the caps file. (diff) | |
download | gentoo-vdr-scripts-c4e55754f75080f8d07e8e859f4caefdb6810d83.tar.gz gentoo-vdr-scripts-c4e55754f75080f8d07e8e859f4caefdb6810d83.tar.bz2 gentoo-vdr-scripts-c4e55754f75080f8d07e8e859f4caefdb6810d83.zip |
Simplify openvt usage.
svn path=/gentoo-vdr-scripts/trunk/; revision=613
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/init.d/vdr | 40 |
1 files changed, 17 insertions, 23 deletions
diff --git a/etc/init.d/vdr b/etc/init.d/vdr index 9ef7dc0..92e8b64 100755 --- a/etc/init.d/vdr +++ b/etc/init.d/vdr @@ -57,28 +57,21 @@ start_vdr() { debug_msg " CMDLINE:" start-stop-daemon "${daemonctrl_opts}" "--" "${vdr_opts}" - if [ -z "${TERMINAL}" ]; then - eval start-stop-daemon ${daemonctrl_opts} \ - -- --daemon ${vdr_opts} - exitcode=$? - else - TERMINAL=${TERMINAL##/dev/tty} - TERMINAL_DEVICE=/dev/tty${TERMINAL} + local _openvt= openvt_opts= TERM_DEV=/dev/tty${TERMINAL} + if [ -n "${TERMINAL}" -a -e "${TERM_DEV}" ]; then + [ "${SWITCH_TO_TERMINAL}" = "yes" ] && openvt_opts="-s" + _openvt="openvt -c ${TERMINAL} ${openvt_opts} --" + { clear - einfo "Starting vdr" - } >${TERMINAL_DEVICE} - - # strange commandline, to be fixed in next versions - openvt_opts="" - if [ "${SWITCH_TO_TERMINAL}" = "yes" ]; then - openvt_opts="${openvt_opts} -s" - fi - eval openvt -c ${TERMINAL} ${openvt_opts} -- \ - start-stop-daemon ${daemonctrl_opts} \ - -- ${vdr_opts} - exitcode=$? + einfo "Starting ${VDRNAME}" + } >${TERM_DEV} + else + add_param --daemon fi + + eval ${_openvt} start-stop-daemon ${daemonctrl_opts} -- ${vdr_opts} + exitcode=$? eend $exitcode "Failed to start vdr." # TODO: Anything todo if starting fails? cleanups? @@ -87,11 +80,12 @@ start_vdr() { if [ "$?" != "0" ]; then exitcode=1 fi - fi - # wenn nachrichten vorhanden sind - if [ -s "${VDR_LOG_FILE}" ]; then - /usr/share/vdr/bin/vdr-bg.sh svdrpsend.pl mesg "Errors: Go to Commands/View VDR Start Log" + # wenn nachrichten vorhanden sind + if [ -s "${VDR_LOG_FILE}" ]; then + /usr/share/vdr/bin/vdr-bg.sh svdrpsend.pl mesg "Errors: Go to Commands/View VDR Start Log" + fi + fi return $exitcode |