forked from ungleich-public/cdist
additional parameter base_dir
This commit is contained in:
parent
5f1afb08f6
commit
342cbca533
3 changed files with 16 additions and 5 deletions
|
@ -19,12 +19,20 @@
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
if [ -f "$__object/parameter/service" ]; then
|
if [ -f "$__object/parameter/script" ]; then
|
||||||
service=$(cat "$__object/parameter/service")
|
script=$(cat "$__object/parameter/script")
|
||||||
else
|
else
|
||||||
service="/$__object_id"
|
script="/$__object_id"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -f "$__object/parameter/base_dir" ]; then
|
||||||
|
base_dir=$(cat "$__object/parameter/base_dir")
|
||||||
|
else
|
||||||
|
base_dir="/etc/init.d"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
mode=$(cat "$__object/parameter/mode")
|
mode=$(cat "$__object/parameter/mode")
|
||||||
|
|
||||||
echo "/etc/init.d/${service} ${mode}"
|
echo "${base_dir}/${script} ${mode}"
|
||||||
|
|
|
@ -23,8 +23,10 @@ OPTIONAL PARAMETERS
|
||||||
-------------------
|
-------------------
|
||||||
script::
|
script::
|
||||||
If supplied, use this as the init-script.
|
If supplied, use this as the init-script.
|
||||||
Otherwise the object_id is used. The script will be pretended with '/etc/init.d/'
|
Otherwise the object_id is used.
|
||||||
|
|
||||||
|
base_dir::
|
||||||
|
If supplied, this type uses this directory instead of '/etc/init.d'. The parameter will not need an ending slash.
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
--------
|
--------
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
script
|
script
|
||||||
|
base_dir
|
||||||
|
|
Loading…
Reference in a new issue