Skip to content

Instantly share code, notes, and snippets.

@asilbalaban
Created July 17, 2023 06:44
Show Gist options
  • Save asilbalaban/f4a72543e3f450d895c0e51aeb17e865 to your computer and use it in GitHub Desktop.
Save asilbalaban/f4a72543e3f450d895c0e51aeb17e865 to your computer and use it in GitHub Desktop.
run python script if not running
#!/bin/bash
if ps aux | grep script.py | grep -v grep > /dev/null
then
echo "The script is running."
else
echo "The script is not running."
/usr/bin/python3 ~/teklif-botu/script.py
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment