Noad.sh

Aus VDR Wiki
(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
(Auf Leistungsschwachen PCs sollte man '''at now''' durch '''batch''' ersetzen.)
Zeile 1: Zeile 1:
<pre>
+
#!/bin/sh
#!/bin/sh
+
#
#
+
# noad.sh - v.0.1
# noad.sh - v.0.1
+
#
#
+
# add this lines to your [[reccmds.conf]]:
# add this lines to your reccmds.conf:
+
# folgende zeilen in die [[reccmds.conf]] eintragen:
# folgende zeilen in die reccmds.conf eintragen:
+
#
#
+
# Start advertising filter      : /usr/local/bin/noad.sh -start
# Start advertising filter      : /usr/local/bin/noad.sh -start
+
# View Cut list                : /usr/local/bin/noad.sh -marks
# View Cut list                : /usr/local/bin/noad.sh -marks
+
# Advertising filter overview  : /usr/local/bin/noad.sh -count
# Advertising filter overview  : /usr/local/bin/noad.sh -count
+
# Stop advertising filter      : /usr/local/bin/noad.sh -stop
# Stop advertising filter      : /usr/local/bin/noad.sh -stop
+
# Stop all advertising filters? : /usr/local/bin/noad.sh -kill
# Stop all advertising filters? : /usr/local/bin/noad.sh -kill
+
 
+
# CONFIG START
# CONFIG START
+
  NOADOPT="nice --background --jumplogo --ac3 --overlap --OSD --statisticfile=/var/log/noadstat"
  NOADOPT="nice --background --jumplogo --ac3 --overlap --OSD --statisticfile=/var/log/noadstat"
+
# CONFIG END
# CONFIG END
+
 
+
PATH=$PATH:/usr/local/bin
PATH=$PATH:/usr/local/bin
+
 
+
case "${1}" in
case "${1}" in
+
      -start)
      -start)
+
        echo "Recording: "
echo "Recording: "
+
        echo
echo
+
        echo "${2}"
echo "${2}"
+
        echo
echo
+
        test -e "${2}/noad.pid" && {
test -e "${2}/noad.pid" && {
+
            echo "Advertising filter is already active."
    echo "Advertising filter is already active."
+
            } || {
    } || {
+
            echo "/usr/local/bin/noad ${NOADOPT} \"${2}\"" | at now
    echo "/usr/local/bin/noad ${NOADOPT} \"${2}\"" | at now
+
            echo "Advertising filter startet."
    echo "Advertising filter startet."
+
        }
}
+
        ;;
;;
+
      -marks)
      -marks)
+
        echo "Recording: "
echo "Recording: "
+
        echo
echo
+
        echo "${2}"
echo "${2}"
+
        echo
echo
+
        test -e "${2}/noad.pid" && {
test -e "${2}/noad.pid" && {
+
            echo "Advertising filter is still active."
    echo "Advertising filter is still active."
+
            echo
    echo
+
        }
}
+
        test -e "${2}/marks.vdr" && {
test -e "${2}/marks.vdr" && {
+
            cat "${2}/marks.vdr"
    cat "${2}/marks.vdr"
+
            } || {
    } || {
+
            echo "There is not missing cut markings."
    echo "There is not missing cut markings."
+
        }
}
+
        ;;
;;
+
      -count)
      -count)
+
        echo "Counting of the advertising filters:"
echo "Counting of the advertising filters:"
+
        echo
echo
+
        ps axc|awk "{if (\$5==\"noad\") print \$1}"|wc -w|tr -d ' '
ps axc|awk "{if (\$5==\"noad\") print \$1}"|wc -w|tr -d ' '
+
        ;;
;;
+
      -stop)
      -stop)
+
        echo "Recording: "
echo "Recording: "
+
        echo
echo
+
        echo "${2}"
echo "${2}"
+
        echo
echo
+
        test -e "${2}/noad.pid" && {
test -e "${2}/noad.pid" && {
+
            kill `cat "${2}/noad.pid"`
    kill `cat "${2}/noad.pid"`
+
            echo "Advertising filter stopped."
    echo "Advertising filter stopped."
+
            } || {
    } || {
+
            echo "Advertising filter is not active."
    echo "Advertising filter is not active."
+
        }
}
+
        ;;
;;
+
      -kill)
      -kill)
+
        killall noad
killall noad
+
        ;;
;;
+
esac
esac
+
</pre>
+
  
 
Auf Leistungsschwachen PCs sollte man '''at now''' durch '''batch''' ersetzen.
 
Auf Leistungsschwachen PCs sollte man '''at now''' durch '''batch''' ersetzen.
 
+
<pre>
+
- echo "/usr/local/bin/noad ${NOADOPT} \"${2}\"" | at now
- echo "/usr/local/bin/noad ${NOADOPT} \"${2}\"" | at now
+
+ echo "/usr/local/bin/noad ${NOADOPT} \"${2}\"" | batch
+ echo "/usr/local/bin/noad ${NOADOPT} \"${2}\"" | batch
+
</pre>
+
  
 
[[Kategorie:Scripts]]
 
[[Kategorie:Scripts]]

Version vom 26. Dezember 2004, 12:58 Uhr

#!/bin/sh
#
# noad.sh - v.0.1
#
# add this lines to your reccmds.conf:
# folgende zeilen in die reccmds.conf eintragen:
#
# Start advertising filter      : /usr/local/bin/noad.sh -start
# View Cut list                 : /usr/local/bin/noad.sh -marks
# Advertising filter overview   : /usr/local/bin/noad.sh -count
# Stop advertising filter       : /usr/local/bin/noad.sh -stop
# Stop all advertising filters? : /usr/local/bin/noad.sh -kill

# CONFIG START
  NOADOPT="nice --background --jumplogo --ac3 --overlap --OSD --statisticfile=/var/log/noadstat"
# CONFIG END

PATH=$PATH:/usr/local/bin

case "${1}" in
      -start)
        echo "Recording: "
        echo
        echo "${2}"
        echo
        test -e "${2}/noad.pid" && {
            echo "Advertising filter is already active."
            } || {
            echo "/usr/local/bin/noad ${NOADOPT} \"${2}\"" | at now
            echo "Advertising filter startet."
        }
        ;;
      -marks)
        echo "Recording: "
        echo
        echo "${2}"
        echo
        test -e "${2}/noad.pid" && {
            echo "Advertising filter is still active."
            echo
        }
        test -e "${2}/marks.vdr" && {
            cat "${2}/marks.vdr"
            } || {
            echo "There is not missing cut markings."
        }
        ;;
      -count)
        echo "Counting of the advertising filters:"
        echo
        ps axc|awk "{if (\$5==\"noad\") print \$1}"|wc -w|tr -d ' '
        ;;
      -stop)
        echo "Recording: "
        echo
        echo "${2}"
        echo
        test -e "${2}/noad.pid" && {
            kill `cat "${2}/noad.pid"`
            echo "Advertising filter stopped."
            } || {
            echo "Advertising filter is not active."
        }
        ;;
      -kill)
        killall noad
        ;;
esac

Auf Leistungsschwachen PCs sollte man at now durch batch ersetzen.

- echo "/usr/local/bin/noad ${NOADOPT} \"${2}\"" | at now
+ echo "/usr/local/bin/noad ${NOADOPT} \"${2}\"" | batch