diff options
author | Martin Prochnow <nordlicht@martins-kabuff.de> | 2006-04-11 19:12:01 +0200 |
---|---|---|
committer | Andreas Mair <andreas@vdr-developer.org> | 2006-04-11 19:12:01 +0200 |
commit | 82bfd4c15949019ede37b2b04be79659c5c65dbe (patch) | |
tree | 5deb5bf0d98cbee6c5ee17bb9323d0748ed567a7 /scripts/dvdarchive.sh | |
parent | c849f2898257df19fddb97ac99c392c410f120d1 (diff) | |
download | vdr-plugin-extrecmenu-82bfd4c15949019ede37b2b04be79659c5c65dbe.tar.gz vdr-plugin-extrecmenu-82bfd4c15949019ede37b2b04be79659c5c65dbe.tar.bz2 |
Version 0.9v0.9
- removed myDvbPlayer, use VDR's cDvbPlayer instead
- made adjustments to work with BigPatch-VDRs (JumpPlay-patch)
- added option for sort recordings
- moved editing of priority and lifetime to its own submenu
- removed option to select alternative dvd marker, the icon is now default
- added default values for setup options
- moved content of patches/ and tools/ to contrib/ and added a small README
- new version of 'dvdarchive.sh'; thanks to vejoun from vdr-portal.de
- fixed problem with archive dvd recordings at the base dir; thanks to Mase from vdr-portal.de for reporting
Diffstat (limited to 'scripts/dvdarchive.sh')
-rwxr-xr-x | scripts/dvdarchive.sh | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/scripts/dvdarchive.sh b/scripts/dvdarchive.sh index 3dc0c71..7f5b72b 100755 --- a/scripts/dvdarchive.sh +++ b/scripts/dvdarchive.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Version 1.2 2006-03-30 +# Version 1.4 2006-04-07 # # Exitcodes: # @@ -15,20 +15,35 @@ # For dvd-in-drive detection download isodetect.c, compile it and put it into the PATH, # usually /usr/local/bin/ # +# Tools needed: mount, awk, find, test +# Optional tools: isodetect #<Configuration> MOUNTCMD="/usr/bin/sudo /bin/mount" UMOUNTCMD="/usr/bin/sudo /bin/umount" + MOUNTPOINT="/media/cdrom" # no trailing '/'! +# Eject DVD for exit-codes 2 and 3 (no or wrong dvd). 1 = yes, 0 = no. +EJECTWRONG=0 +# Eject DVD after unmounting. 1 = yes, 0 = no. +EJECTUMOUNT=0 + #</Configuration> -DEVICE="$(awk '( $1 !~ /^#/ ) && ( $2 == "'$MOUNTPOINT'" ) { print $1; exit; }' /etc/fstab)" # dvd-device, used by isodetect if exists +DEVICE="$(awk '( $1 !~ /^#/ ) && ( $2 == "'$MOUNTPOINT'" ) { printf("%s", $1); exit; }' /etc/fstab)" # dvd-device, used by isodetect if exists REC="$2" NAME="$3" +call() { + echo -e "\nScript $0 needs three parameters. Action, rec and name. Action is mount or umount" + echo -e "Example: dvdarchive.sh mount '/video1.0/Music/%Riverdance/2004-06-06.00:10.50.99.rec' '2004-06-06.00:10.50.99.rec'\n" +} + +[ $# -ne 3 ] && { call; exit 10; } + case "$1" in mount) # check if dvd is in drive, only if isodetect exists @@ -36,6 +51,7 @@ mount) isodetect -d "$DEVICE" >/dev/null 2>&1 if [ $? -ne 0 ]; then echo "no dvd in drive" + [ $EJECTWRONG -eq 1 ] && { eject "$DEVICE"; } exit 2 fi fi @@ -50,6 +66,7 @@ mount) if [ -z "$DIR" ]; then $UMOUNTCMD "$MOUNTPOINT" || { echo "dvd umount error"; exit 1; } echo "wrong dvd in drive / recording not found on dvd" + [ $EJECTWRONG -eq 1 ] && { eject "$DEVICE"; } exit 3 fi # link index.vdr if not exist @@ -84,7 +101,12 @@ umount) rm "$LINK" fi done + [ $EJECTUMOUNT -eq 1 ] && { eject "$DEVICE"; } ;; + *) + echo -e "\nWrong action." + call + ;; esac exit 0 |