Automator to execute shell script with an input text file, copy it to specific directory
EDIT: Workflow now works with one bug: running the workflow twice results in two copies of the control file being copied

Make a new Automator SERVICE. At the beginning, for "receives selected as input" choose "documents". Add the process "set value of variable" and make a new "destination path" variable (default variable name is "destination path"). Add the process "open finder items" to the beginning to open the control file. Add the process "run applescript" to the workflow the code is the following:

on run {input, parameters}

set LineNumber to (the line in which the path is specified in the control file)
tell application "TextEdit"
    set theVariable to paragraph LineNumber of document 1
    set thePath to POSIX path of theVariable
    set thePath to text 1 thru -2 of thePath
end tell

return thePath
end run


I don't know why this couldn't have been in the same block, but you need to add a separate AppleScript process. The code is as follows:

on run {input, parameters}

tell application "Finder"
    set theFolder to POSIX path of input &amp; "/DEBIAN"
    try
        make new folder in folder input with properties {name:"DEBIAN"}
    end try
end tell

return theFolder
end run


Add the process "set value of variable" and make a new destination path variable (default name is "destination path 1").
Add the "get value of variable" process and get the value of the variable with the path of the input file ("destination path"). Click on "options" on this process and check "ignore this action's input".
After this, Automator has a process called "copy finder items" and this can be used to copy the input (the output of "get value of variable", which is the input file). This worked for me, hope it works for you as well. Good luck :)