Skip to content

Instantly share code, notes, and snippets.

@MufidJamaluddin
Last active October 3, 2020 17:31
Show Gist options
  • Save MufidJamaluddin/a104679f67f50e89a105600fe80858de to your computer and use it in GitHub Desktop.
Save MufidJamaluddin/a104679f67f50e89a105600fe80858de to your computer and use it in GitHub Desktop.
Command
#!/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
#!/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