Using sinatra as a web-service

Hi, all.

I’m working on this project, need me to change some config file on a
server.

We are now using : ruby telnet/ssh, to get on the machine,
change/delete/remove file with linux cmd.
which I do not consider a clean solution.

Now I just finish learning sinatra.
I’m thinking to create a web service, provide API like:

http://hostA/file/get/etc/passwd
or
http://hostA/file/remove/tmp/kkk

But I find it hard to deal with url routing with file path involved.

It took me half a day, I still didn’t figure out how to use sinatra to
upload file to a specific folder.

Here’s my question:
1 how to handle file path in url? in post?
2 is there any other solution for this?
3 is sinatra or any other web service framework Lke rails suitable for
this kind of solution?

Thanks

JarodZZZ