Simple bash script to check for services that is not active and attempts to start it.
Inspired from http://www.akamaras.com/linux/linux-script-to-check-if-a-service-is-running-and-start-it-if-its-stopped/
cd my-script-directory/
curl https://raw.githubusercontent.com/jinjie/check-services/master/check-services.sh -o check-services.sh
chmod +x check-services.sh
- Edit check
check-services.sh
and use your own configuration. - Add cron to run script periodically. Make sure the user running the cron have permission to start services.
# Cron example
MAILTO=""
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
* * * * * root /root/check-services/check-services.sh
👤 Kong Jin Jie
- Website: Swift DevLabs
- Twitter: @jinjie
- Github: @jinjie
This is a quick fix for making sure of the services is running on my server. Do feel free to improve.
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a ⭐️ if this project helped you!
This README was generated with ❤️ by readme-md-generator