• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps api for linux

malayo

Newbie
how do I create an app to run commands on linux?

e.g.: a button named shutdown when pressed, shuts down a selected server.

I was told to create an API but not sure how to go about it.
 
You could either make a wrapper around SSH (I.e. when you press a button it executes an SSH binary on your Android device which logs in to a remote machine and runs some shell commands), or run some sort of server on the Linux machine which allows you to connect and perform tasks. It would be pretty easy to build a simple web service which allows you to reboot the machine through a HTTP post.
 
Back
Top Bottom