Skip to content

Instantly share code, notes, and snippets.

@3mrdev
Created May 19, 2020 08:26
Show Gist options
  • Save 3mrdev/3b1c9c12923dffe7c126b022ebd80789 to your computer and use it in GitHub Desktop.
Save 3mrdev/3b1c9c12923dffe7c126b022ebd80789 to your computer and use it in GitHub Desktop.
Simple Bash Script To Restart Odoo Server After Out of Memory Crash
#!/bin/bash
SERVICE=/odoo/odoo-server/odoo-bin
if ps ax | grep -v grep | grep $SERVICE > /dev/null
then
#echo "1"
echo "$SERVICE is running well at `date`" >> /home/firebits/restart.log
else
#echo "2"
echo "$SERVICE is not running. Restarting... at `date`" >> /home/firebits/restart.log
/etc/init.d/odoo-server start > /dev/null
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment