+update of __start_on_boot

Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
remotes/origin/feature_files_export
Nico Schottelius 13 years ago
parent 6b6ae1bde2
commit 42e3c18d02
  1. 2
      conf/type/__start_on_boot/explorer/state
  2. 71
      conf/type/__start_on_boot/gencode-remote
  3. 3
      conf/type/__start_on_boot/man.text

@ -21,7 +21,7 @@
# Check whether the given name will be started on boot or not # Check whether the given name will be started on boot or not
# #
os=$(cat "$__global/explorer/os") os=$("$__explorer/os")
case "$os" in case "$os" in
debian|ubuntu) debian|ubuntu)

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# #
# 2011 Nico Schottelius (nico-cdist at schottelius.org) # 2012 Nico Schottelius (nico-cdist at schottelius.org)
# #
# This file is part of cdist. # This file is part of cdist.
# #
@ -18,49 +18,48 @@
# along with cdist. If not, see <http://www.gnu.org/licenses/>. # along with cdist. If not, see <http://www.gnu.org/licenses/>.
# #
# #
# __file is a very basic type, which will probably be reused quite often
#
destination="/$__object_id" if [ -f "$__object/parameter/state" ]; then
state_should="$(cat "$__object/parameter/state")" state_should="$(cat "$__object/parameter/state")"
exists="$(cat "$__object/explorer/exists")" else
state_should="present"
fi
case "$state_should" in os=$(cat "$__global/explorer/os")
present) name="$__object_id"
# No source? Create empty file
if [ ! -f "$__object/parameter/source" ]; then
if [ "$exists" = "no" ]; then
echo touch \"$destination\"
fi
fi
# Mode settings # Support runlevels later
if [ -f "$__object/parameter/mode" ]; then #runlevel=$(cat $__global/explorer/runlevel)
echo chmod \"$(cat "$__object/parameter/mode")\" \"$destination\"
fi case "$state_should" in
present)
case "$os" in
debian|ubuntu)
echo update-rc.d \"$name\" defaults
;;
# Group gentoo)
if [ -f "$__object/parameter/group" ]; then echo rc-update add \"$name\" default
echo chgrp \"$(cat "$__object/parameter/group")\" \"$destination\" ;;
fi
# Owner centos|fedora|owl|redhat)
if [ -f "$__object/parameter/owner" ]; then echo echo chkconfig \"$name\" on
echo chown \"$(cat "$__object/parameter/owner")\" \"$destination\" ;;
fi
;;
absent) *)
echo "Unsupported os: $os" >&2
exit 1
;;
esac
;;
if [ "$exists" = "yes" ]; then absent)
echo rm -f \"$destination\"
fi
;; ;;
*)
echo "Unknown state: $state_should" >&2
exit 1
;;
*)
echo "Unknown state: $state_should" >&2
exit 1
;;
esac esac

@ -23,6 +23,9 @@ OPTIONAL PARAMETERS
state:: state::
'present' or 'absent', defaults to 'present' 'present' or 'absent', defaults to 'present'
runlevel::
Specify runlevel(s) to affect. Defaults to default or current runlevel.
EXAMPLES EXAMPLES
-------- --------

Loading…
Cancel
Save