You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

starwelsd.init 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #!/bin/bash
  2. #
  3. # starwelsd The starwels server.
  4. #
  5. #
  6. # chkconfig: 345 80 20
  7. # description: starwelsd
  8. # processname: starwelsd
  9. #
  10. # Source function library.
  11. . /etc/init.d/functions
  12. # you can override defaults in /etc/sysconfig/starwelsd, see below
  13. if [ -f /etc/sysconfig/starwelsd ]; then
  14. . /etc/sysconfig/starwelsd
  15. fi
  16. RETVAL=0
  17. prog=starwelsd
  18. # you can override the lockfile via STARWELSD_LOCKFILE in /etc/sysconfig/starwelsd
  19. lockfile=${STARWELSD_LOCKFILE-/var/lock/subsys/starwelsd}
  20. # starwelsd defaults to /usr/bin/starwelsd, override with STARWELSD_BIN
  21. starwelsd=${STARWELSD_BIN-/usr/bin/starwelsd}
  22. # starwelsd opts default to -disablewallet, override with STARWELSD_OPTS
  23. starwelsd_opts=${STARWELSD_OPTS--disablewallet}
  24. start() {
  25. echo -n $"Starting $prog: "
  26. daemon $DAEMONOPTS $starwelsd $starwelsd_opts
  27. RETVAL=$?
  28. echo
  29. [ $RETVAL -eq 0 ] && touch $lockfile
  30. return $RETVAL
  31. }
  32. stop() {
  33. echo -n $"Stopping $prog: "
  34. killproc $prog
  35. RETVAL=$?
  36. echo
  37. [ $RETVAL -eq 0 ] && rm -f $lockfile
  38. return $RETVAL
  39. }
  40. case "$1" in
  41. start)
  42. start
  43. ;;
  44. stop)
  45. stop
  46. ;;
  47. status)
  48. status $prog
  49. ;;
  50. restart)
  51. stop
  52. start
  53. ;;
  54. *)
  55. echo "Usage: service $prog {start|stop|status|restart}"
  56. exit 1
  57. ;;
  58. esac