Skip to content

Instantly share code, notes, and snippets.

@sashka
Created August 28, 2014 13:31
Show Gist options
  • Save sashka/885d453d567df8b46623 to your computer and use it in GitHub Desktop.
Save sashka/885d453d567df8b46623 to your computer and use it in GitHub Desktop.
#!/bin/bash
response=$(mysql -P 9306 -h 127.0.0.1 --connect-timeout=3 -e 'select count(*) from products\G' | grep count | cut -d' ' -f2)
if [ "${response}" == "" ]; then
sudo /etc/init.d/sphinxsearch restart
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment