Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #
- # hdactl This shell script takes care of starting and stopping hdactl.
- #
- # chkconfig: 345 65 35
- # description: hdactl provides support for dynamically updating DHCP/DNS services
- # processname: hdactl
- # config: /etc/sysconfig/hdactl
- # Source function library.
- . /etc/rc.d/init.d/functions
- # Source networking configuration.
- . /etc/sysconfig/network
- # Check that networking is up.
- [ "$NETWORKING" = "no" ] && exit 0
- . /etc/sysconfig/hdactl
- exec="/usr/bin/hdactl"
- prog=$(basename $exec)
- lockfile=/var/lock/subsys/$prog
- start() {
- if [ -f $lockfile ]; then
- return 0
- fi
- if [ ! -e /var/cache/hdactl.cache ]; then
- logger "hdactl: this hda has not been completely installed; exiting"
- return 0
- fi
- echo -n $"Starting $prog: "
- daemon $exec $HDACTL_OPTIONS
- retval=$?
- echo
- [ $retval -eq 0 ] && touch $lockfile
- stop() {
- echo -n $"Stopping $prog: "
- killproc $prog
- retval=$?
- echo
- [ $retval -eq 0 ] && rm -f $lockfile
- return $retval
- }
- restart() {
- stop
- start
- }
- reload() {
- restart
- }
- force_reload() {
- restart
- }
- fdrstatus() {
- status $prog
- }
- # See how we were called.
- case "$1" in
- start|stop|restart|reload)
- $1
- ;;
- force-reload)
- force_reload
- ;;
- status)
- fdrstatus
- ;;
- [...]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement