How to stop running this macro after open an app in shell script?

I want to Execute a shell:

export https_proxy=;export http_proxy=;export all_proxy=socks5://
nohup /Applications/ &

The spotube will be running in proxy mode. But this macro is running all the time until I close spotube. Is that possible to stop running this macro automatically after open the spotube?