1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#!/bin/sh set -e echo " + Reloading services..." for SERVICE in apache2 haproxy postgresql redis-server do if service ${SERVICE} status > /dev/null 2>&1 then echo -n " + ${SERVICE}:" service ${SERVICE} reload || service ${SERVICE} restart echo " done." fi done