Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions MFA_Mail_Start.sh
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
#
# this script is calld by .bashrc to monitor MFA_Mail execution and
# this script is calld by .bashrc to monitor MFA_Mail_OAUTH execution and
# restart if needed.
#
# OZINDFW 29 March 2025
#

if pgrep -f "MFA_Mail.py" >/dev/null
if pgrep -f "MFA_Mail_OAUTH.py" >/dev/null
then
echo "MFA_Mail Already Running"
echo "MFA_Mail_OAUTH Already Running"
exit
else
source mfa_env/bin/activate
python MFA_Mail.py &
logger "MFA_Mail starting"
python MFA_Mail_OAUTH.py &
logger "MFA_Mail_OAUTH starting"
echo
echo "MFA_Mail starting"
echo "MFA_Mail_OAUTH starting"
date
echo
fi
while [ true ]
do
if pgrep -f "MFA_Mail.py" >/dev/null
if pgrep -f "MFA_Mail_OAUTH.py" >/dev/null
then
sleep 5
else
echo
echo "MFA_Mail not running, restarting "
echo "MFA_Mail_OAUTH not running, restarting "
date
echo
logger "MFA_Mail not running, restarting "
logger "MFA_Mail_OAUTH not running, restarting "
source mfa_env/bin/activate
python MFA_Mail.py &
python MFA_Mail_OAUTH.py &
fi
done;