Skip to content

Instantly share code, notes, and snippets.

@krupenik
Last active December 27, 2015 08:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krupenik/7300083 to your computer and use it in GitHub Desktop.
Save krupenik/7300083 to your computer and use it in GitHub Desktop.
dead simple service launcher
#! /bin/bash
PATH=/usr/sbin:/sbin:/usr/bin:/bin
services=(cron syslogd)
start_service() {
service=$1
echo "$service is not running." >&2
$service
echo "$service started." >&2
}
for service in ${services[@]}; do
pidof $service > /dev/null || start_service $service &
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment