Last active
October 3, 2020 17:31
-
-
Save MufidJamaluddin/a104679f67f50e89a105600fe80858de to your computer and use it in GitHub Desktop.
Command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if ! pgrep -f 'binary_app' | |
then | |
nohup /home/file_path/binary_app && echo "baru running" > ./out_test.txt | |
else | |
echo "udah di-run" > ./out_test.txt | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if pgrep -f 'binary_app' | |
then | |
pgrep -f 'binary_app' | xargs kill && echo "baru stop" > ./out_test.txt | |
else | |
echo "udah di-stop" > ./out.txt | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment