0

So, I have been doing MEAN stack web development for some time now. I am normally used to Angular UI development and executing CRUD operations using node servers.

Now, I have a new requirement - Create a UI for running some shell scripts on a remote Linux server.

For example:-

files are located in a path such as files/bin/example.sh in the remote server. I have to be able to perform operations via my UI such as:-

example.sh status device name

example.sh start device name 

How can I do this? Can anyone give me some directions?

Thanks.

1
  • you cannot access files on server from angular directly without using a back end server Commented Nov 20, 2019 at 6:35

1 Answer 1

1

You can use this shelljs npm package to do that. you will have to write a REST API that will execute your shell script from the server-side (Using node js).

ex

const shell = require('shelljs')
shell.exec('./path_to_your_file')

And then you can call that REST endpoint from your angular application.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.