source: trunk/packages/invirt-base/files/lib/init/config-init.sh @ 1567

Last change on this file since 1567 was 1445, checked in by broder, 16 years ago

Use invoke-rc.d instead of calling init scripts directly in
invirt-base's config-init.sh

File size: 781 bytes
RevLine 
[1211]1# For a package which only configures another, "parent" package.
2#
3# Global variable PARENTPACKAGE names parent; may be array
4# for zero or many parents.
5#
6# Global variable PACKAGE names this package, for log message.
7#
8# Requires bash.
9
10. /lib/init/vars.sh
11. /lib/lsb/init-functions
12. /lib/init/gen-files.sh
13
14config_init () {
15  case "$1" in
16    start|reload|force-reload|restart)
17      log_begin_msg "Reloading config for $PACKAGE"
18      gen_files
19      log_end_msg $?
20      for p in "${PARENTPACKAGE[@]}"; do
[1445]21        invoke-rc.d "$p" "$1"
[1211]22      done
23      ;;
24    stop)
25      for p in "${PARENTPACKAGE[@]}"; do
[1445]26        invoke-rc.d "$p" "$1"
[1211]27      done
28      ;;
29    *)
30      log_success_msg "Usage: /etc/init.d/$PACKAGE {start|reload|force-reload|restart|stop}"
31      ;;
32  esac
33}
Note: See TracBrowser for help on using the repository browser.