Shell Script Problem Synology DS 214 play

Any questions? Need some help?
Post Reply
c0ut
Posts: 8
Joined: 06 Jan 2014, 08:42

Shell Script Problem Synology DS 214 play

Post by c0ut »

My shell script run.sh make an error.

Pyload Says:
ERROR ExternalScripts: Error in run.sh: [Errno 2] No such file or directory

run.sh located in:
/var/packages/pyload/target/pyload/module/plugins/unrar_finished/run.sh


I have no idea why my script won't work. My Shell Script skill is very bad :(

Code: Select all

#!/bin/bash

# Globale Variablen #
DATE=$(date +%d.%m.%Y\ %H:%M:%S)
DownloadDir=/volume1/video/Download
MediaDir=/volume1/video/
logline=$(date +'%d.%m.%Y')" "$(date +'%H:%M:%S')" FileBot"
LogFile=/volume1/@appstore/pyload/var/config/Logs/log.txt                         # LogFile


#Pyload
DownloadFolder=$MediaDir/$1
SERVICE=unrar
SERVICE2=filebot

#FileBot-defs
MovieFormat="movieFormat=Movies/{net.sourceforge.filebot.WebServices.TMDb.getMovieInfo(movie, Locale.GERMAN).name} {'('+y+')'}/{net.sourceforge.filebot.WebServices.TMDb.getMovieInfo(movie, Locale.GERMAN).name} {'('+y+')'}"
Ignore="ignore=\b(?i:doku)\b"
Extras="clean=y artwork=n"

echo -e "$logline ##########################" | tee -a $LogFile
echo -e "$logline ............unrar_finished" | tee -a $LogFile


x=1
while (ps ax | grep -v grep | grep -v $0 | grep $SERVICE > /dev/null && [ $x -le 20 ])
do
echo -e "$logline $SERVICE still running ...WAITING..." | tee -a $LogFile
        sleep 10
        x=$(( $x + 1 ))
done


y=5
while (ps ax | grep -v grep | grep -v $0 | grep $SERVICE2 > /dev/null && [ $y -le 2 ])
        do
                echo -e "$logline $SERVICE2 already running ..wait 60 secs" | tee -a $LogFile
                sleep 60
                y=$(( $y + 1 ))
        done


if (ps ax | grep -v grep | grep -v $0 | grep $SERVICE > /dev/null || ps ax | grep -v grep | grep -v $0 | grep $SERVICE2)
        then
                echo -e "$logline $SERVICE2 or $SERVICE still running - ABORT" | tee -a $LogFile
                exit
        else
                # Funktionen #
                sortiere(){
                filebot -script fn:amc "$DownloadFolder" --output "$MediaDir" --conflict override -non-strict --action move --def "$MovieFormat" "$Ignore" $Extras
                }
                cleaning(){
                filebot -script fn:cleaner "$DownloadFolder" --def root=y "$Ignore" "exts=jpg|nfo|rar|etc" "terms=sample|trailer|etc"
                }
             

                # Ausfuehren #
                # Execute the functions#
                echo -e "$logline sorting Files with Filebot" | tee -a $LogFile
                sortiere
                echo -e "$logline cleaning Clutter with Filebot" | tee -a $LogFile
                cleaning
                #echo -e "$logline XBMC clean" | tee -a $LogFile
                #xbmc_clean
                #echo -e "$logline XBMC scan" | tee -a $LogFile
                #xbmc_scan

User avatar
rednoah
The Source
Posts: 23002
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Shell Script Problem Synology DS 214 play

Post by rednoah »

Probably permissions. Did you forget to run chmod +x in the script to make it executable?
:idea: Please read the FAQ and How to Request Help.
c0ut
Posts: 8
Joined: 06 Jan 2014, 08:42

Re: Shell Script Problem Synology DS 214 play

Post by c0ut »

No. I have chmod this file. I think a location problem? Variables with ""? When i run this normally with my ssh errors like location and this:
: not founde 6:
: not founde 7:
: not founde 12:
: not founde 19:
##########################
............unrar_finished
: not founde 22:
: not founde 23:
run.sh: line 25: syntax error: unexpected word (expecting "do")
Post Reply