View difference between Paste ID: veq9miyX and M0WQKa6m
SHOW: | | - or go back to the newest paste.
1
#!/bin/sh
2-
###########################################################################
2+
3-
# CONFIGURATION ###########################################################
3+
#-----------------------------------------------------------------------
4-
###########################################################################
4+
#----- Scriptstart - Initialscript für pyLoad Hook "package_finished"
5-
CHECK=`find "/volume1/public/downloads/" -maxdepth 1 -type f -name "*.avi"`
5+
#----- Script unter "./pyload/scripts/package_finished" oder
6-
PROOF=`find "/volume1/public/downloads/" -maxdepth 1 -type f -name "*.mp4"`
6+
#----- "./pyload/scripts/unrar_finished" speichern und ausfuehrbar machen
7-
DIR_IN=/volume1/public/downloads/
7+
#----- "chmod +x [Scriptname]" 
8-
DIR_END=/volume1/public/downloads/scripts/incomming/
8+
#-----
9-
DIR_SC=/opt/pyload/scripts/unrar_finished/
9+
#----- Script zur Datei / Ordner Umbenennung findet ihr unter http://pastebin.com/mWW5usaB
10
#----- Script (siehe Link) unter personalisierter Pfadangabe der Variablen "SCRP" speichern
11-
   if test -n "$CHECK" -a -n "$PROOF"
11+
#----- und ausfuehrbar machen "chmod +x [Scriptname]"
12-
      then { cd $DIR_IN ; mv *.avi $DIR_END ; mv *.mp4 $DIR_END ;
12+
#-----------------------------------------------------------------------
13-
        cd $DIR_SC ; sh runscript.sh ; }
13+
14-
   elif test -n "$CHECK"
14+
#-----------------------------------------------------------------------
15-
      then { cd $DIR_IN ; mv *.avi $DIR_END ; cd $DIR_SC ; sh runscript.sh ; }
15+
# nachfolgende Pfadangaben bitte anpassen
16-
   elif test -n "$PROOF"
16+
#-----------------------------------------------------------------------
17-
      then { cd $DIR_IN ; mv *.mp4 $DIR_END ; cd $DIR_SC ; sh runscript.sh ; }
17+
18-
   else
18+
PATH=/opt/bin:/opt/sbin
19-
exit
19+
PREFIX="/share/Public" # dein "Home-Verzeichnis" 
20-
   fi
20+
SCRP=/share/Public # Pfad zur runscript.sh http://pastebin.com/mWW5usaB
21
UNRARALL=${PREFIX}/unrarall # Pfad zu unrarall https://github.com/arfoll/unrarall
22-
###########################################################################
22+
DESTINATION=/share/Qmultimedia/ # dein Download-Zielverzeichnis - ANPASSEN!
23-
# End of script
23+
DESTISERIEN=/share/Qmultimedia/Serien # Serien-Verzeichnis - ANPASSEN!
24-
###########################################################################
24+
LOGFILE=${PREFIX}/pyload_finished.txt # Logfile-Pfad
25
UNRARON=1 # Downloads/Archive entpacken: ja = 1 - nein = 0
26
DELNAME=${PREFIX}/DELNAME # Datei welche die Ersetzungsvariablen enthaelt
27
SERIES=${PREFIX}/SERIEN # Datei welche die Serienvariablen enthaelt
28
UF_FOLDER=$2 # $2 = "package_finished" $1 = "unrar_finished"
29
30
#-----------------------------------------------------------------------
31
# sende personalisierte Angaben an runscript.sh http://pastebin.com/mWW5usaB
32
#-----------------------------------------------------------------------
33
34
export UF_FOLDER
35
export DESTINATION
36
export DESTISERIEN
37
export DELNAME
38
export SERIES
39
export LOGFILE
40
41
#-----------------------------------------------------------------------
42
# Logfile-Ausgabe, setze "#" um Log zu deaktivieren
43
#-----------------------------------------------------------------------
44
45
echo "`date`START arguments unrar_finished" >>$LOGFILE
46
echo "$0 0 Scriptname" >>$LOGFILE
47
echo "$1 1. Argument" >>$LOGFILE
48
echo "$2 2. Argument" >>$LOGFILE
49
echo "$# Argumente gesamt" >>$LOGFILE
50
echo STOP arguments unrar_finished >>$LOGFILE
51
52
#-----------------------------------------------------------------------
53
# Wenn UNRARON=1 entpacke Archive
54
#-----------------------------------------------------------------------
55
56
if [ $UNRARON = 1 ]; then
57
 cd "$UF_FOLDER"
58
  `$UNRARALL -d "$UF_FOLDER" --full-path -c`	
59
fi
60
61
#-----------------------------------------------------------------------
62
# Kopiere und starte das Haupt-Script
63
#-----------------------------------------------------------------------
64
65
sleep 5
66
cp $SCRP/runscript.sh "$UF_FOLDER/"
67
cd "$UF_FOLDER"
68
./runscript.sh &
69
sleep 240
70
exit 0
71
72
#-----------------------------------------------------------------------
73
# Scriptende
74
#-----------------------------------------------------------------------