Annotation of /branches/R11-unstable/include/sysvinit.sminc
Parent Directory | Revision Log
Revision 24893 -
(hide annotations)
(download)
Tue Nov 25 02:21:44 2014 UTC (9 years, 10 months ago) by niro
File size: 755 byte(s)
Tue Nov 25 02:21:44 2014 UTC (9 years, 10 months ago) by niro
File size: 755 byte(s)
-release R11-unstable
1 | niro | 19668 | # sysvinit specific functions |
2 | |||
3 | # automatical inherit sysvinit.minc | ||
4 | # this will provide the service management functions | ||
5 | INHERITS+=" sysvinit" | ||
6 | |||
7 | DEPEND="${DEPEND} | ||
8 | >= virtual/sysvinit" | ||
9 | |||
10 | sminclude mtools | ||
11 | |||
12 | # installs initscripts | ||
13 | # minstallrc /path/to/rc-script {destfilename} | ||
14 | minstallrc() | ||
15 | { | ||
16 | local rcscript | ||
17 | local file | ||
18 | |||
19 | [[ -z "$1" ]] && die "No initscript given" | ||
20 | |||
21 | # if no fullpath given use file from sourcedir | ||
22 | if [[ -z $(dirname $1) ]] || [[ $(dirname $1) = . ]] | ||
23 | then | ||
24 | file="${SOURCEDIR}/$(mpname)/$1" | ||
25 | else | ||
26 | file="$1" | ||
27 | fi | ||
28 | |||
29 | if [[ -n "$2" ]] | ||
30 | then | ||
31 | rcscript="$2" | ||
32 | else | ||
33 | rcscript="$(basename ${file})" | ||
34 | fi | ||
35 | |||
36 | # needed directory | ||
37 | minstalldir /etc/rc.d/init.d || die | ||
38 | |||
39 | # install our initscript | ||
40 | minstallexec ${file} /etc/rc.d/init.d/${rcscript} || die | ||
41 | } |