The goal is to copy some .sh files that I tweaked from someone code to encode .mkv to mp4 with then hardsub them I did not really know how to do it from scratch with sabnzbd then run the bash scripts that find .mkv and runs all the encoding and everything..
The problem is copy my Bash from my post folder to the nzb final destination folder is not working, I tried to "debug" it by adding echos to see if the function were called, they are called indeed but its like if bash that is copied is not executed.
my code
Code: Select all
#!/bin/bash
echo $1
echo $2
echo $3
folder=$1
copyscripts () {
echo "ok"
echo $folder
cp -fv ~/post/domkvtomp4.sh $folder
cp -fv ~/post/ass-to-srt.sh $folder
echo "done"
}
runscript () {
echo "do bash"
echo $folder/domkvtomp4.sh
chmod 777 $folder/domkvtomp4.sh
chmod 777 $folder/ass-to-srt.sh
bash $folder/domkvtomp4.sh
echo "done bash"
}
copyscripts
sleep 2
runscript
SAB script output
Code: Select all
/home/lithiume3/downloads/sabnzbd/complete/[A-Destiny]_Toriko_-_111_(848x480_h264_AAC)_[D0A1036E]
[A-Destiny]_Toriko_-_111_(848x480_h264_AAC)_[D0A1036E].nzb
[A-Destiny]_Toriko_-_111_(848x480_h264_AAC)_[D0A1036E]
ok
/home/lithiume3/downloads/sabnzbd/complete/[A-Destiny]_Toriko_-_111_(848x480_h264_AAC)_[D0A1036E]
`/home/lithiume3/post/domkvtomp4.sh' -> `/home/lithiume3/downloads/sabnzbd/complete/[A-Destiny]_Toriko_-_111_(848x480_h264_AAC)_[D0A1036E]/domkvtomp4.sh'
`/home/lithiume3/post/ass-to-srt.sh' -> `/home/lithiume3/downloads/sabnzbd/complete/[A-Destiny]_Toriko_-_111_(848x480_h264_AAC)_[D0A1036E]/ass-to-srt.sh'
done
do bash
/home/lithiume3/downloads/sabnzbd/complete/[A-Destiny]_Toriko_-_111_(848x480_h264_AAC)_[D0A1036E]/domkvtomp4.sh
done bash