#!/bin/bash # # unbound Unbound lightweight DNS resolver # # Startup script for Redhat / CentOS 5.x # # chkconfig: 2345 80 30 # description: Unbound is a DNS resolver, which relays DNS queries to authoritative name servers. # processname: unbound # pidfile: /var/run/unbound/unbound.pid # config: /usr/local/etc/unbound/unbound.conf # # 15/04/09: Initial write. D Webber Advosys Consulting Inc. # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 [ -x /usr/local/sbin/unbound ] || exit 0 [ -d /usr/local/etc/unbound ] || exit 0 RETVAL=0 prog="unbound" pidfile=/var/run/unbound/unbound.pid start() { # Start daemons. echo -n $"Starting Unbound DNS resolver: " /usr/local/sbin/unbound && success || failure $"$prog start" RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/unbound echo return $RETVAL } stop() { # Stop daemons. echo -n $"Shutting down Unbound DNS resolver: " killproc -p $pidfile unbound RETVAL=$? [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/unbound echo return $RETVAL } restart() { stop start } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart) stop start ;; *) echo $"Usage: $0 {start|stop|restart}" exit 1 esac exit $?