diff --git a/Build/synOTR.sh b/Build/synOTR.sh index f2ea053..756927d 100644 --- a/Build/synOTR.sh +++ b/Build/synOTR.sh @@ -8,8 +8,8 @@ echo " -----------------------------------" echo -e - CLIENTVERSION="4.0.8" # [2018-12-17] - DevChannel="Release" # beta + CLIENTVERSION=`get_key_value /var/packages/synOTR/INFO version` + DevChannel="Release" # beta [2018-12-20] # --------------------------------------------------------------------------------- # GRUNDKONFIGRUATIONEN / INDIVIDUELLE ANPASSUNGEN / Standardwerte | @@ -685,6 +685,18 @@ if [ $decoderactiv = "on" ] && [ ! -z "$filetest" ] ; then echo 2 > /dev/ttyS1 #short beep sleep 1 fi + if [ ! -z $PBTOKEN ] ; then + PB_LOG=`curl $cURLloglevel --header "Access-Token:${PBTOKEN}" https://api.pushbullet.com/v2/pushes -d type=note -d title="synOTR" -d body="Film [$filename] ist fertig."` + if [ $LOGlevel = "2" ] ; then + echo " PushBullet-LOG:" + echo "$PB_LOG" + elif echo "$PB_LOG" | grep -q "error"; then # für Loglevel 1 nur Errorausgabe + echo -n " PushBullet-Error: " + echo "$PB_LOG" | jq -r '.error_code' + fi + else + echo " (PushBullet-TOKEN nicht gesetzt)" + fi wget --timeout=30 --tries=2 -q -O - "http://${synotrdomain}/synOTR/synOTR_FILECOUNT" >/dev/null 2>&1 needindex=1 fi @@ -1577,6 +1589,18 @@ if [ $OTRcutactiv = "on" ] ; then if [ $dsmbeepnotify = "on" ] ; then echo 2 > /dev/ttyS1 #short beep fi + if [ ! -z $PBTOKEN ] ; then + PB_LOG=`curl $cURLloglevel --header "Access-Token:${PBTOKEN}" https://api.pushbullet.com/v2/pushes -d type=note -d title="synOTR" -d body="Film [$filedestname] ist fertig."` + if [ $LOGlevel = "2" ] ; then + echo " PushBullet-LOG:" + echo "$PB_LOG" + elif echo "$PB_LOG" | grep -q "error"; then # für Loglevel 1 nur Errorausgabe + echo -n " PushBullet-Error: " + echo "$PB_LOG" | jq -r '.error_code' + fi + else + echo " (PushBullet-TOKEN nicht gesetzt)" + fi wget --timeout=30 --tries=2 -q -O - "http://${synotrdomain}/synOTR/synOTR_FILECOUNT" >/dev/null 2>&1 needindex=1 fi @@ -1749,7 +1773,7 @@ if [ $OTRcutactiv = "on" ] ; then if [ $dsmtextnotify = "on" ] ; then title=${filename%.*} sleep 1 - synodsmnotify $MessageTo "synOTR" "[$title] ist fertig" + synodsmnotify $MessageTo "synOTR" "Film [$title] ist fertig" sleep 1 fi if [ $dsmbeepnotify = "on" ] ; then @@ -1757,6 +1781,18 @@ if [ $OTRcutactiv = "on" ] ; then echo 2 > /dev/ttyS1 #short beep sleep 1 fi + if [ ! -z $PBTOKEN ] ; then + PB_LOG=`curl $cURLloglevel --header "Access-Token:${PBTOKEN}" https://api.pushbullet.com/v2/pushes -d type=note -d title="synOTR" -d body="Film [$title] ist fertig."` + if [ $LOGlevel = "2" ] ; then + echo " PushBullet-LOG:" + echo "$PB_LOG" + elif echo "$PB_LOG" | grep -q "error"; then # für Loglevel 1 nur Errorausgabe + echo -n " PushBullet-Error: " + echo "$PB_LOG" | jq -r '.error_code' + fi + else + echo " (PushBullet-TOKEN nicht gesetzt)" + fi wget --timeout=30 --tries=2 -q -O - "http://${synotrdomain}/synOTR/synOTR_FILECOUNT" >/dev/null 2>&1 needindex=1 fi @@ -1969,7 +2005,7 @@ if [ $OTRavi2mp4active = "on" ] && [ ! -z "$filetest" ] ; then synoindex -a "${pfad}${title}.mp4" if [ $dsmtextnotify = "on" ] ; then sleep 1 - synodsmnotify $MessageTo "synOTR" "[$title] ist fertig" + synodsmnotify $MessageTo "synOTR" "Film [$title] ist fertig" sleep 1 fi if [ $dsmbeepnotify = "on" ] ; then @@ -1977,6 +2013,18 @@ if [ $OTRavi2mp4active = "on" ] && [ ! -z "$filetest" ] ; then echo 2 > /dev/ttyS1 #short beep sleep 1 fi + if [ ! -z $PBTOKEN ] ; then + PB_LOG=`curl $cURLloglevel --header "Access-Token:${PBTOKEN}" https://api.pushbullet.com/v2/pushes -d type=note -d title="synOTR" -d body="Film [$title] ist fertig."` + if [ $LOGlevel = "2" ] ; then + echo " PushBullet-LOG:" + echo "$PB_LOG" + elif echo "$PB_LOG" | grep -q "error"; then # für Loglevel 1 nur Errorausgabe + echo -n " PushBullet-Error: " + echo "$PB_LOG" | jq -r '.error_code' + fi + else + echo " (PushBullet-TOKEN nicht gesetzt)" + fi wget --timeout=30 --tries=2 -q -O - "http://${synotrdomain}/synOTR/synOTR_FILECOUNT" >/dev/null 2>&1 needindex=1 fi @@ -2285,7 +2333,7 @@ for i in $(find "$WORKDIR" -maxdepth 1 -name "*TVOON*avi" -o -name "*TVOON*mp4" synoindex -a "${WORKDIR}${NewName}" if [ $dsmtextnotify = "on" ] ; then sleep 1 - synodsmnotify $MessageTo "synOTR" "[$title] ist fertig" + synodsmnotify $MessageTo "synOTR" "Film [$title] ist fertig" sleep 1 fi if [ $dsmbeepnotify = "on" ] ; then @@ -2293,6 +2341,18 @@ for i in $(find "$WORKDIR" -maxdepth 1 -name "*TVOON*avi" -o -name "*TVOON*mp4" echo 2 > /dev/ttyS1 #short beep sleep 1 fi + if [ ! -z $PBTOKEN ] ; then + PB_LOG=`curl --header "Access-Token:${PBTOKEN}" https://api.pushbullet.com/v2/pushes -d type=note -d title="synOTR" -d body="Filme [$film] ist fertig."` + if [ $LOGlevel = "2" ] ; then + echo "PushBullet-LOG:" + echo "$PB_LOG" + elif echo "$PB_LOG" | grep -q "error"; then # für Loglevel 1 nur Errorausgabe + echo -n "PushBullet-Error: " + echo "$PB_LOG" | jq -r '.error_code' + fi + else + echo "PushBullet-TOKEN nicht erkannt" + fi wget --timeout=30 --tries=2 -q -O - "http://${synotrdomain}/synOTR/synOTR_FILECOUNT" >/dev/null 2>&1 needindex=1 fi @@ -2404,7 +2464,7 @@ if [ $OTRrenameactiv = "on" ] && [ $firstrunonday == "1" ] ; then if jq -e . >/dev/null 2>&1 <<<"$serieninfo"; then # prüfen, ob korrektes JSON-Format verarbeitet werden kann (https://stackoverflow.com/questions/46954692/check-if-string-is-a-valid-json-with-jq) echo -e "gefunden:" echo "OTRID: $OTRID" - serietitle=`echo "$serieninfo" | jq -r '.Serie' | sed "s/://g" ` # jq ist ein Kommandozeilen-JSON-Parser + serietitle=`echo "$serieninfo" | jq -r '.Serie' | sed "s/://g" ` echo "serietitle: $serietitle" season=`echo "$serieninfo" | awk -F, '{print $3}' | awk -F: '{print $2}' | sed "s/\"//g"` season="$(printf '%02d' "$season")" # 2stellig mit führender Null @@ -2513,7 +2573,7 @@ if [ $OTRrenameactiv = "on" ] && [ $firstrunonday == "1" ] ; then if [ $dsmtextnotify = "on" ] ; then sleep 1 - synodsmnotify $MessageTo "synOTR" "[$title] ist fertig" + synodsmnotify $MessageTo "synOTR" "Film [$title] ist fertig" sleep 1 fi if [ $dsmbeepnotify = "on" ] ; then @@ -2712,7 +2772,7 @@ if [ $useWORKDIR == "yes" ] && [ ! -z "$filetest" ]; then if [ $dsmtextnotify = "on" ] ; then sleep 1 - synodsmnotify $MessageTo "synOTR" "[$filename] ist fertig" + synodsmnotify $MessageTo "synOTR" "Film [$filename] ist fertig" sleep 1 fi if [ $dsmbeepnotify = "on" ] ; then @@ -2720,6 +2780,18 @@ if [ $useWORKDIR == "yes" ] && [ ! -z "$filetest" ]; then echo 2 > /dev/ttyS1 #short beep sleep 1 fi + if [ ! -z $PBTOKEN ] ; then + PB_LOG=`curl $cURLloglevel --header "Access-Token:${PBTOKEN}" https://api.pushbullet.com/v2/pushes -d type=note -d title="synOTR" -d body="Film [$filename] ist fertig."` + if [ $LOGlevel = "2" ] ; then + echo " PushBullet-LOG:" + echo "$PB_LOG" + elif echo "$PB_LOG" | grep -q "error"; then # für Loglevel 1 nur Errorausgabe + echo -n " PushBullet-Error: " + echo "$PB_LOG" | jq -r '.error_code' + fi + else + echo " (PushBullet-TOKEN nicht gesetzt)" + fi wget --timeout=30 --tries=2 -q -O - "http://${synotrdomain}/synOTR/synOTR_FILECOUNT" >/dev/null 2>&1 needindex=1 @@ -2744,7 +2816,7 @@ if [ $useWORKDIR == "yes" ] && [ ! -z "$filetest" ]; then if [ $dsmtextnotify = "on" ] ; then sleep 1 - synodsmnotify $MessageTo "synOTR" "[$filename] ist fertig" + synodsmnotify $MessageTo "synOTR" "Film [$filename] ist fertig" sleep 1 fi if [ $dsmbeepnotify = "on" ] ; then @@ -2752,6 +2824,18 @@ if [ $useWORKDIR == "yes" ] && [ ! -z "$filetest" ]; then echo 2 > /dev/ttyS1 #short beep sleep 1 fi + if [ ! -z $PBTOKEN ] ; then + PB_LOG=`curl $cURLloglevel --header "Access-Token:${PBTOKEN}" https://api.pushbullet.com/v2/pushes -d type=note -d title="synOTR" -d body="Film [$filename] ist fertig."` + if [ $LOGlevel = "2" ] ; then + echo " PushBullet-LOG:" + echo "$PB_LOG" + elif echo "$PB_LOG" | grep -q "error"; then # für Loglevel 1 nur Errorausgabe + echo -n " PushBullet-Error: " + echo "$PB_LOG" | jq -r '.error_code' + fi + else + echo " (PushBullet-TOKEN nicht gesetzt)" + fi wget --timeout=30 --tries=2 -q -O - "http://${synotrdomain}/synOTR/synOTR_FILECOUNT" >/dev/null 2>&1 needindex=1 else