Create a python script so that it will run locally and call other scripts in a remote server after user make selection.

Job ID: 30959335

Budget: $10 – $30 USD

we have several program running in a remote server, and this is how we run the program on the remote server
program-run --config-file simnow-xx or
program-run --config-file prod-xx

$ src/run.sh send-signal

this will query the remote instance and return the following info:

Running instances:
1. simnow-a1
2. simnow-a2
3. prod-b1

Available signals:
a: SIGUSR1 reload config
b: SIGUSR2 gracefully stop
c: XXXX hedge position
d: XXXX clear position
e: etc, etc

Choose an instane and signal pair (e.g., "1 b"):
Then if user enters 1 b (and hit ENTER), it continues to print:

"Will send SIGUSR1 (reload config) to "simnow-a1". Confirm [y/N]?""

Then if user enters y, it does this operation (for example reload config, it will call the reload_config.sh in remote server). If user enters anything else, it goes back to the initial state (printing the instances and signals)

in the script, we can define the Available signals.
Related categories: Python Linux Shell Script