Hi,
first, what is the difference if i name a script dvdbackup_to_dvd_complete.sh or !dvdbackup_to_dvd_complete.sh ?
i ask this because i can't see a difference at the execution in the openpli-7.2rc on the vu ultimo 4k
as example i have here since years a script which can copy a dvd from a usb dvd-drive to the hdd as dvd structure (VIDEO_TS,AUDIO_TS)
it is named dvdbackup_to_dvd_complete.sh and i start it with a hotkey, it looks as following;
#!/bin/bash ## Variablen ## BOXIP=http://localhost DVDBACKUP_PACKAGE=dvdbackup DVDBACKUP=/usr/bin/dvdbackup NICE=/bin/nice NICE_ARGS="-n 19" WGET=/usr/bin/wget DVD_ROM=/dev/sr0 HDD=/media/hdd TARGETDIR=$HDD/movie/_Converted/video/dvdbackup WORKDIR=$HDD/movie/_Converted/_temp DVD_INFO=$WORKDIR/dvd_info.txt TMP=/tmp LOGFILE=$TMP/dvdbackup.log # Konsole (Fenster im OSD am TV) schliessen damit man das bei Ausfuehrung # direkt an der Box mit z.b: Hotkey nicht selbst zu tun braucht. sleep 3 $WGET -q -O - $BOXIP/web/remotecontrol?command=352 # Generelles Logging. ##exec >$LOGFILE; exec 2>&1 (funktioniert nicht in der bash (OpenATV ab Version 4.2 hat bash an Board)) exec 3>&1 4>&2 trap 'exec 2>&4 1>&3' 0 1 2 3 exec 1>$LOGFILE 2>&1 # Falls das Script erneut gestartet wird da es zuvor aus welchem Grund auch # immer abgebrochen ist, die eventuell verbliebenen Altlasten loeschen. if [ -d $WORKDIR/*/ ] ; then $NICE $NICE_ARGS rm -rf $WORKDIR/*/ fi # Job Start/Startzeit STARTDATE="$(date +%a.%d.%b.%Y-%H:%M)" && echo -e "\n\nJOB START -> $STARTDATE\n\n" && sleep 7 $WGET -O - -q "$BOXIP/web/message?text=Starte%20DVD%20kopieren%20...%20->%20$STARTDATE&type=1&timeout=10" > /dev/null && sleep 5 # OSD Fehler Ausgabe. osd_error_message() { sleep 11 $WGET -O - -q "$BOXIP/web/message?text=ABBRUCH%20---%20(%20Details%20dazu%20in%20$LOGFILE%20)&type=3" > /dev/null echo "" } # Benoetigtes Paket (dvdbackup) nachinstallieren falls nicht vorhanden. if [ ! -f $DVDBACKUP ] ; then opkg update if [ "$?" = "0" ] ; then echo -e "\nPaketmanagement Aktualisierung erfolgreich.\n" opkg install $DVDBACKUP_PACKAGE if [ "$?" = "0" ] ; then echo -e "Installation Programm $DVDBACKUP_PACKAGE erfolgreich.\n" else osd_error_message echo "ABBRUCH !\nInstallation Programm $DVDBACKUP_PACKAGE fehlgeschlagen." echo -e "Bitte Programm $DVDBACKUP_PACKAGE manuell installieren,\nund das Script erneut starten.\n" && exit 1 fi else osd_error_message echo -e "\nABBRUCH !\nPaketmanagement Aktualisierung fehlgeschlagen -> Netzwerkverbindung pruefen." echo "Oder das Programm $DVDBACKUP_PACKAGE manuell installieren," echo -e "da dieses fehlt aber unbedingt erforderlich ist, damit das Script laeuft.\n" && exit 1 fi else echo -e "\nProgramm $DVDBACKUP_PACKAGE ist vorhanden.\n" fi # Benoetigte Verzeichnisse erstellen falls nicht vorhanden. if [ ! -d $TARGETDIR -o ! -d $WORKDIR ] ; then echo "" for verz in $TARGETDIR $WORKDIR do mkdir -p $verz if [ "$?" = "0" ] ; then echo -e "\nVerzeichnis;\n$verz\nerfolgreich angelegt.\n" else osd_error_message echo -e "\nABBRUCH !\nVerzeichnis;\n$verz\nanlegen fehlgeschlagen." echo -e "Bitte manuell erstellen,\nund das Script erneut starten.\n" && exit 1 fi done fi # Berechnung ob genuegend Speicherplatz auf der HDD vorhanden ist um die DVD zu kopieren. # Benoetigt wird hier in etwa die DVD-Groesse + zur Sicherheit noch ca. 200 Mb mehr. DVDSIZE="$(df -m $DVD_ROM | grep '/' | awk {'print $3'})" DVDSIZE=`expr $DVDSIZE + 200` HDDFREE="$(df -m $HDD |grep $HDD |awk '{print $4}')" if [ "$DVDSIZE" -ge "$HDDFREE" ] ; then DIFFERENCE=`expr $DVDSIZE - $HDDFREE + 200` osd_error_message echo "ABBRUCH !\nZu wenig freier Plattenplatz." echo "Bitte zusaetzlich ungefaehr $DIFFERENCE MB Platz auf" echo -e "der Platte frei machen, und das Script erneut starten.\n" && exit 1 fi if [ "$DVDSIZE" -lt "$HDDFREE" ] ; then echo -e "\nGenuegend freier Plattenplatz -> $HDDFREE MB <- vorhanden.\n" fi # DVD auslesen um den Titel fuer die fertige DVD zu bestimmen. $DVDBACKUP -i $DVD_ROM -I > $DVD_INFO DVDTITEL=$(cat $DVD_INFO | grep "DVD-Video information" | cut -d" " -f8- | tr -d [\"]) if [ -z "$DVDTITEL" ] ; then NAME="NO_LABEL" DATE="$(date +%a-%b-%Y-%H-%M)" DVDTITEL=$NAME-$DATE echo -e "\n\nKein DVD-Titel erkannt -> DVD-Titel = $DVDTITEL\n" else DVDTITEL=${DVDTITEL//[ ]/_} DVDTITEL=${DVDTITEL//Ä/AE} DVDTITEL=${DVDTITEL//Ö/OE} DVDTITEL=${DVDTITEL//Ü/UE} DVDTITEL=${DVDTITEL//ä/ae} DVDTITEL=${DVDTITEL//ö/oe} DVDTITEL=${DVDTITEL//ü/ue} DVDTITEL=${DVDTITEL//ß/SS} echo -e "\n\nDVD-Titel = $DVDTITEL\n" fi # DVD komplett kopieren - DVD-Struktur (AUDIO_TS,VIDEO_TS) wird erstellt. echo -e "\nKopiere DVD $DVDTITEL -> auf die Platte ..." $NICE $NICE_ARGS $DVDBACKUP -n $DVDTITEL -M -i $DVD_ROM -o $WORKDIR if [ "$?" = "0" ] ; then echo -e "\nDVD $DVDTITEL wurde erfolgreich kopiert.\n" else osd_error_message echo -e "\nABBRUCH !\nDVD $DVDTITEL kopieren fehlgeschlagen." echo -e "Sorry, hat leider nicht geklappt - eventuell mit einer anderen DVD erneut versuchen.\n" && exit 1 fi # Manchmal gibt es DVDs die nur den VIDEO_TS bzw. video_ts Ordner beinhalten, fuer diesen # Fall wird fuer beste Kompatibilitaet der fehlende AUDIO_TS bzw. audio_ts Ordner erstellt. if ( [ -d $WORKDIR/$DVDTITEL/VIDEO_TS ] && [ ! -d $WORKDIR/$DVDTITEL/AUDIO_TS ] ) ; then mkdir $WORKDIR/$DVDTITEL/AUDIO_TS if [ "$?" = "0" ] ; then echo -e "\nOrdner AUDIO_TS fuer beste DVD Kompatibilitaet wurde erstellt in:" echo -e "$WORKDIR/$DVDTITEL\n" fi elif ( [ -d $WORKDIR/$DVDTITEL/video_ts ] && [ ! -d $WORKDIR/$DVDTITEL/audio_ts ] ) ; then mkdir $WORKDIR/$DVDTITEL/audio_ts if [ "$?" = "0" ] ; then echo -e "\nOrdner audio_ts fuer beste DVD Kompatibilitaet wurde erstellt in:" echo -e "$WORKDIR/$DVDTITEL\n" fi fi # Verschieben der DVD-Struktur (AUDIO_TS, VIDEO_TS) in das Zielverzeichnis (TARGETDIR). echo -e "\nVerschiebe DVD $DVDTITEL nach ->\n$TARGETDIR ..." $NICE $NICE_ARGS mv $WORKDIR/$DVDTITEL $TARGETDIR if [ "$?" = "0" ] ; then echo -e "\nDVD $DVDTITEL wurde erfolgreich verschoben nach:\n$TARGETDIR\n" else $WGET -O - -q "$BOXIP/web/message?text=DVD%20$DVDTITEL%20verschieben%20fehlgeschlagen%20-%20nicht%20tragisch%20,%20(%20Details%20dazu%20in%20$LOGFILE%20)&type=2&timeout=15" > /dev/null echo -e "\n! DVD $DVDTITEL verschieben fehlgeschlagen - nicht tragisch !" echo -e "Einfach manuell z.b: per EMC nach:\n$TARGETDIR verschieben," echo "und zwar deshalb weil für den Fall eines Abbruchs des" echo "Scripts, bei einem erneuten Start des Scripts alles unter:" echo -e "$WORKDIR geloescht wird.\n" fi # Job Ende/Endzeit bei Erfolg bzw. bei Teilerfolg falls nur die DVD-Struktur (AUDIO_TS,VIDEO_TS) erstellt werden konnte. ENDDATE="$(date +%a.%d.%b.%Y-%H:%M)" && echo -e "\nJOB ENDE -> $ENDDATE\n\n" $WGET -O - -q "$BOXIP/web/message?text=DVD%20kopieren%20erfolgreich%20beendet%20.%20->%20$ENDDATE&type=1" > /dev/null exit
earlier in older pli images (version 4) and in other images as oatv it works without problems, it starts and then it close first the window and then it runs further in the background, because i need no output only a message if it fails with a message that say have a look in the logfile or if it is ready.
this messages i become with wget commands.
but now in openpli-7.2rc it didn't work anymore is i wish.
in spite of i have the line as following at the begin of the script;
$WGET -q -O - $BOXIP/web/remotecontrol?command=352
to close the window, the window doesn't close and the script didn't run in the background as previous.
now the window persits open till the script is complete ready, and in this time you can't do something other with the box, that's not good.
i thought now if i rename the script to;
!dvdbackup_to_dvd_complete.sh
then it works correct (it close the window and run in background) but it's exact the same problem.
so for what is it good to rename a script to !blabla.sh instead of blabla.sh ?
regards
Pike
Edited by Pike_Bishop, 20 October 2019 - 18:50.