[Feature Requests] Enviromentshell cleanup / exit script
With the enviromentshell i can prepare the shell for direct usage or run a command in there. It would be nice to have also the ability to have an exit script.
So that i can build up environments with static background services running and shutting them down after im finished.
The thing is it can't guarantee that the exit script is run. If you just close the terminal window, it will probably not be run
Wouldnt it possible, to detect if a process is still launched and if not run exit script and close?
At the moment the function as following if i understand right. If i open the enviromentshell then the command get run and i get a subprocess that gives me a terminal of choice.
if i open a command connection under the environment it opens the command as a sub process of the enviroment.
Wouldnt it be possible to watch if there are still child processes and the enviromentshell itself is not used and then run the exit script and quit?
I guess that would be possible somehow.
But it still wouldn't cover the case when the connection is just lost, e.g. if you lose internet connectivity.
Let me think about something first, maybe also in conjunction with the other issue about setting the status of services commands.
How does something like this look like
That could also be combined with your other issue about updating the service state
is it possible to have this in a way that it functions like an enviromentshell? I mean that i can have under it commands?
Additional, when i use the service to make a connection and close the connection, how can i validate if one or multiple endpoints are available or not.
This is useful for opening up a tunnel though a service and also get the connection status. What is not possible with this solution is to see if some computers at the target location are reachable.
Can you elaborate a little bit on your view of this feature?
I mean i could also change the usage, so use this feature to directly establish a tunnel to one singular endpoint and from there connect in one script to the target and close that with the exit script. That is possible. My thought until now was more like: i have an enviromentshell that opens up a connection to a location and there i have multiple commands to open specific services like rdp,ssh,.... .
Maybe calling it service control in my screenshot is wrong. I could also call it script control. The idea is to create something like you're looking for, i.e. a way to start a shell with commands and also stop the service/system/whatever that you started later on. You can have that under commands. It has nothing to do with tunnels.
To achieve that, there has to be a consistent way to check the state of it with a status script. If that status script returns != 0, it indicates that the start script needs to be run when you want to start it. When you want to stop it, if the status script returns 0, the stop script will be run. For the actual scripts, you put in the commands to start/stop/check status off your specific services and endpoints.
The status script can then also be used to dynamically update the state from the API whether it is available or not