Advertisement
Guest User

Untitled

a guest
Jan 3rd, 2019
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. init () {
  4.  
  5. test -f $DAEMON || exit 0
  6.  
  7. case "$1" in
  8. start)
  9. echo "Starting $DESC..."
  10. if [ $LOG ] ; then
  11. $DAEMON $PARAMS 2>>/var/log/$LOG &
  12. else
  13. $DAEMON $PARAMS &>/dev/null &
  14. fi
  15. echo $! > $PIDFILE
  16. ;;
  17. stop)
  18. echo "Stopping $DESC..."
  19. if [ $STOP ] ; then
  20. $STOP $PARAMS
  21. else
  22. [ -f $PIDFILE ] && kill $(cat $PIDFILE) &>/dev/null
  23. fi
  24. ;;
  25. restart|reload)
  26. "$0" stop
  27. "$0" start
  28. ;;
  29. *)
  30. echo "$NAME init script usage: $0 {start|stop|restart}"
  31. return 1
  32. esac
  33.  
  34. return $?
  35.  
  36. }
  37.  
  38.  
  39. rc () {
  40.  
  41. if [ -d /etc/rc.d ] && [ $0 == "/etc/init.d/rcK" ]; then
  42. for x in $(ls -r /etc/rc.d/) ; do
  43. /etc/rc.d/$x stop
  44. done
  45. return 1
  46. fi
  47. for i in /etc/rc.d/??* ; do
  48. [ ! -f "$i" ] && continue
  49. case "$i" in
  50. *.sh)
  51. (
  52. trap - INT QUIT TSTP
  53. set start
  54. . $i
  55. )
  56. ;;
  57. *)
  58. $i start
  59. ;;
  60. esac
  61. done
  62. sleep 1
  63. clear
  64. return 1
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement