summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Mair <andreas@vdr-developer.org>2010-08-30 09:18:16 +0200
committerAndreas Mair <andreas@vdr-developer.org>2010-08-30 09:18:16 +0200
commit4fba847191fd57ad879ca660fb5f27dfd8cb84a5 (patch)
tree458537c014030d24a13d20207c107c03cb75fb22
parent57a99e05234ffc28bb3a1d16c058bf38ce629d82 (diff)
downloadvdr-plugin-extrecmenu-4fba847191fd57ad879ca660fb5f27dfd8cb84a5.tar.gz
vdr-plugin-extrecmenu-4fba847191fd57ad879ca660fb5f27dfd8cb84a5.tar.bz2
Merged with v1.3-devel head.
-rw-r--r--contrib/README16
-rwxr-xr-xscripts/dvdarchive.sh73
2 files changed, 65 insertions, 24 deletions
diff --git a/contrib/README b/contrib/README
index 3ec797d..adba3b3 100644
--- a/contrib/README
+++ b/contrib/README
@@ -8,7 +8,19 @@ isodetect.c
Checks, if a dvd is in the drive. Used optionally by dvdarchive.sh
Compile with 'gcc isodetect.c -o isodetect'
-vdr-1.3.43-extrecmenu.diff
+MainMenuHooks-v1_0.patch
-------------------------------------------------------------------------------
A patch to replace VDR's recordings menu with the plugin
-Apply with 'patch < vdr-1.3.43.extrecmenu.diff'
+Apply with 'patch < MainMenuHooks-v1_0.patch' in VDR's source directory
+
+hddarchive
+-------------------------------------------------------------------------------
+see hddarchive/README
+
+rating
+-------------------------------------------------------------------------------
+see rating/README.
+
+reclist
+-------------------------------------------------------------------------------
+see reclist/README
diff --git a/scripts/dvdarchive.sh b/scripts/dvdarchive.sh
index 9dad5ed..0886b6c 100755
--- a/scripts/dvdarchive.sh
+++ b/scripts/dvdarchive.sh
@@ -1,13 +1,13 @@
-#!/bin/bash
+#!/bin/sh
#
-# Version 2.1 2006-06-02
+# Version 2.3-beta 2006-07-14
#
# Author: Mike Constabel
-# VDR-Portal: vejoun
-# EMail: vejoun @ toppoint.de
-# WWW: http://www.constabel.net/vdr/scripts.htm
+# VDR-Portal.de: vejoun
+# EMail: vejoun at toppoint dot de
+# WWW: http://www.constabel.net/vdr/scripts.de.htm
#
-# ---> CONFIGURATION AT LINE 79 <---
+# ---> CONFIGURATION AT LINE 83 <---
#
# MANUAL:
# -------
@@ -35,7 +35,7 @@
# You find isodetect.c in the extrecmenu plugin source package.
#
# 4.
-# Tools needed: mount, awk, find, test, stat
+# Tools needed: mount, awk, find, test, stat, sed
# Optional tools: isodetect
#
# 5.
@@ -59,20 +59,37 @@
#
# HISTORY:
# --------
-# 2.1 - Fixed bug in testing if dvd is mounted
+# 2006-07-14: Version 2.3-beta
+#
+# - should be compatible with ash, busybox
+# stays beta until someone confirm this or 2.4 comes
+#
+# 2006-06-13: Version 2.2
+#
+# - at mount, if third parameter is not given, take last part of path
+#
+# Version 2.1
+#
+# - Fixed bug in testing if dvd is mounted
# - more DEBUG=1 output
#
-# 2.0 - more logging
+# Version 2.0
+#
+# - more logging
# - check if mountpoint and device exists
# - Debug Log in file $DEBUGLOG if $DEBUG is 1, for easier error reporting
#
-# 1.9 - use "sudo mount --bind" for mounting if filesystem is vfat
+# Version 1.9
+#
+# - use "sudo mount --bind" for mounting if filesystem is vfat
# - automatic fallback to 'sudo' and 'mount --bind' if filesystem is vfat
# - mounting more failure tolerant
# - added MANUAL part in script
# - length.vdr creation, you must not use it ;)
#
-# 1.8 - remove sudo, is not necessary
+# Version 1.8
+#
+# - remove sudo, is not necessary
# - on mount, if already mounted try to umount first
# - logging per syslog, see $SYSLOG
#
@@ -81,31 +98,36 @@
#<Configuration>
# Mountpoint, the same as in fstab
-MOUNTPOINT="/media/cdrom" # no trailing '/'
+MOUNTPOINT="/media/brenner" # no trailing '/'
# Eject DVD for exit-codes 2 and 3 (no or wrong dvd). 1 = yes, 0 = no.
-EJECTWRONG=0
+EJECTWRONG=1
# Eject DVD after unmounting. 1 = yes, 0 = no.
EJECTUMOUNT=0
# Log warnings/errors in syslog. 1 = yes, 0 = no.
-SYSLOG=0
+SYSLOG=1
# Create a length.vdr after mounting the dvd for the played recording. 1 = yes, 0 = no.
# Only for non-vfat and with index.vdr only on dvd.
-GETLENGTH=0
+GETLENGTH=1
# Put debug infos in file $DEBUGLOG. Only if $DEBUG=1.
DEBUG=0
DEBUGLOG="/tmp/dvdarchive.sh-debug.log"
#</Configuration>
+
+# read config file
+. /etc/vdr/dvdarchive.conf
+
#
# No changes needed after this mark
# Remove trailing slash
-MOUNTPOINT=${MOUNTPOINT/%\/}
+MOUNTPOINT="$(echo "${MOUNTPOINT}" | sed -e 's/\/$//')"
+
if [ -L "$MOUNTPOINT" ]; then
MOUNTPOINTT="$(find "$MOUNTPOINT" -printf "%l")"
else
@@ -123,6 +145,10 @@ ACTION="$1"
REC="$2"
NAME="$3"
+if [ "$ACTION" = "mount" -a -z "$NAME" ]; then
+ NAME="basename ${REC})"
+fi
+
# function to print help
call() {
echo -e "\nScript $0 needs three parameters for mount and two for umount. The first must be mount or umount, the second is the full path.\n"
@@ -167,8 +193,8 @@ log() {
# Some checks before doing something
[ "$ACTION" = "mount" -o "$ACTION" = "umount" ] || { call; exit 10; }
-[ -z "$REC" ] && { call; exit 10; }
-[ "$ACTION" = mount -a -z "$NAME" ] && { call; exit 10; }
+[ -z "$REC" -o ! -d "$REC" ] && { call; exit 10; }
+[ "$ACTION" = "mount" -a -z "$NAME" ] && { call; exit 10; }
[ ! -d "$MOUNTPOINT" ] && { log error "Mountpoint $MOUNTPOINT doesn't exist"; exit 10; }
[ ! -e "$DEVICE" ] && { log error "Device $DEVICE doesn't exist"; exit 10; }
@@ -187,8 +213,7 @@ mount)
if mount | egrep -q " $MOUNTPOINTT "; then
# check if dvd is in use
if mount | egrep -q "^$DEVICET"; then
- log error "dvd in use (at: check if dvd is in use)"
- exit 1
+ log warning "dvd in use (at: check if dvd is in use)"
fi
# if already mountet, try to umount
log warning "dvd already mounted, try to umount"
@@ -216,10 +241,14 @@ mount)
if [ "$(stat -f -c %T "$REC")" != "vfat" ]; then
# link index.vdr if not exist
if [ ! -e "${REC}/index.vdr" ]; then
- cp -s "${DIR}/index.vdr" "${REC}/" || { log error "could not link index.vdr (at: link index.vdr from dvd to disk)"; }
+ ln -s "${DIR}/index.vdr" "${REC}/index.vdr" || { log error "could not link index.vdr (at: link index.vdr from dvd to disk)"; }
fi
# link [0-9]*.vdr files
- cp -s "${DIR}"/[0-9]*.vdr "${REC}/"
+ #cp -s "${DIR}"/[0-9]*.vdr "${REC}/"
+ #find "${DIR}"/ -name "[0-9]*.vdr" -exec ln -s "${REC}/$(basename "{}")"
+ for FILE in "${DIR}/"[0-9]*.vdr; do
+ ln -s "$FILE" "${REC}/$(basename "$FILE")"
+ done
# error while linking [0-9]*.vdr files?
if [ $? -ne 0 ]; then
log error "error while linking [0-9]*.vdr"