Noad.sh

Aus VDR Wiki
(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
 
Zeile 1: Zeile 1:
#!/bin/sh
+
<pre>#!/bin/sh
#
+
#
# sample script for noad
+
# sample script for noad
#
+
#
# need: noad, at
+
# need: noad, at
  
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/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
+
      pidof noad|wc -w|tr -d ' '
        pidof noad|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."
+
      }
        }
+
      ;;
        ;;
+
esac</pre>
esac
+

Version vom 21. August 2004, 00:25 Uhr

#!/bin/sh
#
# sample script for noad
#
# need: noad, at

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/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
       pidof noad|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."
       }
       ;;
esac