diff options
author | Christian Heim <phreak@gentoo.org> | 2006-04-07 11:56:04 +0000 |
---|---|---|
committer | Christian Heim <phreak@gentoo.org> | 2006-04-07 11:56:04 +0000 |
commit | 7978075fa644e5de43d6ea3433b40549a31fe342 (patch) | |
tree | dec7584dbf162325a6a0b0f6903bad30a1dc0753 /sbin/rc-services.sh | |
parent | Merging r1948 (diff) | |
download | baselayout-vserver-7978075fa644e5de43d6ea3433b40549a31fe342.tar.gz baselayout-vserver-7978075fa644e5de43d6ea3433b40549a31fe342.tar.bz2 baselayout-vserver-7978075fa644e5de43d6ea3433b40549a31fe342.zip |
Merging r1959
svn path=/baselayout-vserver/trunk/; revision=313
Diffstat (limited to 'sbin/rc-services.sh')
-rwxr-xr-x | sbin/rc-services.sh | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/sbin/rc-services.sh b/sbin/rc-services.sh index 199a8d2..df0b557 100755 --- a/sbin/rc-services.sh +++ b/sbin/rc-services.sh @@ -255,11 +255,40 @@ is_runlevel_stop() { [[ -d "${svcdir}/softscripts.new" ]] } +# void save_options(char *option, char *optstring) +# +# save the settings ("optstring") for "option" +# +save_options() { + local myopts="$1" + + shift + if [[ ! -d "${svcdir}/options/${SVCNAME}" ]] ; then + mkdir -p -m 0755 "${svcdir}/options/${SVCNAME}" + fi + + echo "$*" > "${svcdir}/options/${SVCNAME}/${myopts}" +} + +# char *get_options(char *option) +# +# get the "optstring" for "option" that was saved +# by calling the save_options function +# +get_options() { + local svc="${SVCNAME}" + [[ -n $2 ]] && svc="$2" + + if [[ -f "${svcdir}/options/${svc}/$1" ]] ; then + echo "$(< ${svcdir}/options/${svc}/$1)" + fi +} + # void sevice_message([char *type] char *message) # # Print out a service message if we are on parallel service_message() { - [[ ${RC_PARALLEL_STARTUP} != "yes" ]] && return + [[ ${RC_PARALLEL_STARTUP} != "yes" || ${RC_QUIET} == "yes" ]] && return local cmd="einfo" case "$1" in |