Skip to content

Instantly share code, notes, and snippets.

@MiLk
Created January 11, 2014 11:06
Show Gist options
  • Save MiLk/8369577 to your computer and use it in GitHub Desktop.
Save MiLk/8369577 to your computer and use it in GitHub Desktop.
Nagios init script
start() {
test -x $exec || exit 5
test -f $config || exit 6
if test "$checkconfig" = "true"; then
check_config
fi
options="-d"
if test "$use_precached_objects" = "true"; then
options="$options -u"
fi
if test ! -z "$pidfile"; then
options="$options -F $pidfile"
fi
echo -n $"Starting $prog: "
# We need to _make sure_ the precache is there and verified
# Raise priority to make it run better
daemon --user=$user $exec $options $config
retval=$?
echo
test $retval -eq 0 && touch $lockfile
return $retval
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment