Page 1 of 1

Unix based Script with Cygwin?

Posted: 01 Jan 2016, 21:39
by Veepas
Hello dear Filebot Community,

i'm trying to work out a script to automate the rename process for my tv shows.
I'm on Win 10 and Filebot 4.6.1 installed with the Win installer.

Now i found a script that should work for me but unfortunately it is written for a Unix based System but not for Windows. :(
Can you tell me what changes are needed to make this work on Windows ?

Here is my Script:

Code: Select all

#!/bin/sh

BaseDir="Z:\video\SERIEN\"

DownloadFolderTVde="Z:\admin\download\complete"

Serie="{n.replaceAll(/[!?.]+\$/).replaceAll(/[\`´‘’ʻ]/, \"'\").replace(':',' -')}"

Titel="{t.replaceAll(/[!?.]+\$/).replaceAll(/[\`´‘’ʻ]/, \"'\").replace(':',' -')}"

setfacl -Rb "${DownloadFolderTVde}"

chown root:users "${DownloadFolderTVde}" -R

find "${DownloadFolderTVde}" -type d -exec chmod 775 {} +

find "${DownloadFolderTVde}" -type f -exec chmod 664 {} +

filebot -rename "${DownloadFolderTVde}" --db thetvdb --format "${BaseDir}/${Serie}/Staffel {s} DE + EN {vf}/${Serie} - {s00e00} - ${Titel}" -non-strict -r --override auto

filebot -script fn:cleaner "${DownloadFolderTVde}"

find "${BaseDir}" -type d -exec chmod 775 {} +

find "${BaseDir}" -type f -exec chmod 664 {} +
In the end this should automate in cooperation with sabnzbd. So when Sabnzbd finished the download Filebot should do the rest.
I hope u can help me i really appreciate any help

Greetings Veepas :)

Re: Convert Unix Script to Windows??

Posted: 05 Jan 2016, 23:03
by Veepas
Is there noone who can help me ?
Could somebody at least explain me how to write a script that would work in Windows ?

Lets say i use this code what else would i need to make this work ?

Code: Select all

BaseDir="Z:\video\SERIEN\"

DownloadFolderTVde="Z:\admin\download\complete"

Serie="{n.replaceAll(/[!?.]+\$/).replaceAll(/[\`´‘’ʻ]/, \"'\").replace(':',' -')}"

Titel="{t.replaceAll(/[!?.]+\$/).replaceAll(/[\`´‘’ʻ]/, \"'\").replace(':',' -')}"

setfacl -Rb "${DownloadFolderTVde}"

chown root:users "${DownloadFolderTVde}" -R

find "${DownloadFolderTVde}" -type d -exec chmod 775 {} +

find "${DownloadFolderTVde}" -type f -exec chmod 664 {} +

filebot -rename "${DownloadFolderTVde}" --db thetvdb --format "${BaseDir}/${Serie}/Staffel {s} DE + EN {vf}/${Serie} - {s00e00} - ${Titel}" -non-strict -r --override auto

filebot -script fn:cleaner "${DownloadFolderTVde}"
Also my drive Z is a NAS do i need to make it look like 192.168.178.43:\video\SERIEN\ ???

Hope somebody knows what to do

Thanks guys

Re: Convert Unix Script to Windows??

Posted: 06 Jan 2016, 06:31
by rednoah
You can't just "convert" a BASH script to Windows CMD.

The bash script makes use of tools and features that don't exist in Windows CMD, and thus it'd be extremely time consuming to rewrite the script for Windows CMD, and it might not even be possible at all because that's how much Windows CMD sucks.

Re: Convert Unix Script to Windows??

Posted: 06 Jan 2016, 11:34
by Veepas
What about using Cygwin with this script does it work that way ? i think i will give that a try
problem is i really depend on Windows but i also need Scripts to work :(