mirror of the now-defunct rocklinux.org
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.

55 lines
2.0 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/base/sysvinit/parse-config
  9. # ROCK Linux is Copyright (C) 1998 - 2004 Clifford Wolf
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or
  14. # (at your option) any later version. A copy of the GNU General Public
  15. # License can be found at Documentation/COPYING.
  16. #
  17. # Many people helped and are helping developing ROCK Linux. Please
  18. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  19. # file for details.
  20. #
  21. # --- ROCK-COPYRIGHT-NOTE-END ---
  22. if [ "$ROCKCFG_PKG_SYSVINIT_INITSTYLE" = "sysv_text" ] ||
  23. [ "$ROCKCFG_PKG_SYSVINIT_INITSTYLE" = "sysv_nice" ]
  24. then
  25. install_init() {
  26. name=$1 ; file=$2 ; set `grep '# Runlevel: ' $file | cut -f3- -d' '`
  27. spri=$1 ; kpri=`expr 100 - $spri` ; initdir="$root/etc/rc.d" ; shift
  28. echo -n "Install SysV Init script '$name' ($spri/$kpri): "
  29. m4 -Dinitstyle=$ROCKCFG_PKG_SYSVINIT_INITSTYLE \
  30. -D"D_prefix=/$prefix" -D"D_sysconfdir=$sysconfdir" \
  31. -D"D_docdir=$docdir" -D"D_localstatedir=$localstatedir" \
  32. -D"D_datadir=$datadir" -D"D_infodir=$infodir" \
  33. -D"D_bindir=$bindir" -D"D_sbindir=$sbindir" \
  34. -D"D_libdir=$libdir" -D"D_mandir=$mandir" \
  35. $base/package/base/sysvinit/init_macros.m4 \
  36. $file > $initdir/init.d/$name
  37. chmod +x $initdir/init.d/$name
  38. #
  39. for runlevel ; do
  40. echo -n " $runlevel"
  41. if [ "$runlevel" != rcX ] ; then
  42. ln -sf ../init.d/$name $initdir/$runlevel.d/S$spri$name
  43. ln -sf ../init.d/$name $initdir/$runlevel.d/K$kpri$name
  44. else
  45. echo "The script '$name' has the priority $pri." \
  46. > $initdir/rcX.d/X$spri$name
  47. fi
  48. done
  49. #
  50. echo " done."
  51. }
  52. fi