cleanup type __file, it can use cat from current dir directly now

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-02-16 19:42:10 +01:00
parent 252a64ffa9
commit 709271fd2e
2 changed files with 14 additions and 8 deletions

View file

@ -2,8 +2,6 @@
# This is a sample manifest, but used in real world # This is a sample manifest, but used in real world
# #
set -x
# All ikqs get a sample file # All ikqs get a sample file
case "$__cdist_target_host" in case "$__cdist_target_host" in
ikq*|localhost) ikq*|localhost)

View file

@ -18,25 +18,33 @@
# 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 and should be able to be used as an
# example for typewrites later
#
. cdist-config
case "$__arg_type" in type="$(cat type)"
mode="$(cat mode)"
path="$(cat path)"
case "$type" in
directory) directory)
echo mkdir \"$__arg_path\" echo mkdir \"$path\"
;; ;;
file) file)
echo touch \"$__arg_path\" echo touch \"$path\"
;; ;;
*) *)
echo "Unsupported type: $__arg_type" >&2 echo "Unsupported type: \"$type\"" >&2
exit 1 exit 1
;; ;;
esac esac
if [ "$__arg_mode" ]; then if [ "$mode" ]; then
echo chmod \"$__arg_mode\" \"$__arg_path\" echo chmod \"$mode\" \"$path\"
fi fi