nelu / rutorrent-filemanager

Shell file management plugin for ruTorrent webUI
Other
26 stars 11 forks source link

can you use sh instead bash? bash isn't installed on my docker image. #3

Closed nelu closed 4 years ago

nelu commented 4 years ago

@nelu can you use sh instead bash? bash isn't installed on my docker image.

#!/usr/bin/env sh

cmd=$(echo $*)
sh -c "$cmd" 2>&1

echo "{\"exitcode\":$?}"
exit 0

Originally posted by @Magicalex in https://github.com/nelu/rutorrent-filemanager/issues/2#issuecomment-569541864

nelu commented 4 years ago

docker run env sample here https://github.com/nelu/rutorrent-dock

nelu commented 4 years ago

@nelu can you use sh instead bash? bash isn't installed on my docker image.

#!/usr/bin/env sh

cmd=$(echo $*)
sh -c "$cmd" 2>&1

echo "{\"exitcode\":$?}"
exit 0

Originally posted by @Magicalex in #2 (comment)

a merge request with the actual repo code would be nice from your behalf. its a good optimization contribution

Magicalex commented 4 years ago

Yes but the problem is still present...

You have a bad xmlrpc request in your code.

[16.02.20 21:18:08] <?xml version="1.0" encoding="UTF-8"?><methodCall><methodName>execute.capture</methodName><params>
<param><value><string></string></value></param>
<param><value><string>/rutorrent/app/plugins/filemanager/src/../scripts/sucmd.sh</string></value></param>
<param><value><string>find '/data/downloads' -mindepth 1 -maxdepth 1 -printf '%y\t%f\t%s\t%C@\t%#m\n'  2&gt;&amp;1</string></value></param>
</params></methodCall>
[16.02.20 21:18:08] Status: 200 OK
Content-Type: text/xml
Content-Length: 296

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<fault>
<value><struct>
<member><name>faultCode</name>
<value><i4>-503</i4></value></member>
<member><name>faultString</name>
<value><string>Bad return code.</string></value></member>
</struct></value>
</fault>
</methodResponse>

[16.02.20 21:20:41] <?xml version="1.0" encoding="UTF-8"?><methodCall><methodName>execute.capture</methodName><params>
<param><value><string></string></value></param>
<param><value><string>/rutorrent/app/plugins/filemanager/src/../scripts/sucmd.sh</string></value></param>
<param><value><string>find '/data/downloads' -mindepth 1 -maxdepth 1 -printf '%y\t%f\t%s\t%C@\t%#m\n'  2&gt;&amp;1</string></value></param>
</params></methodCall>
[16.02.20 21:20:41] Status: 200 OK
Content-Type: text/xml
Content-Length: 296

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<fault>
<value><struct>
<member><name>faultCode</name>
<value><i4>-503</i4></value></member>
<member><name>faultString</name>
<value><string>Bad return code.</string></value></member>
</struct></value>
</fault>
</methodResponse>