On Tue, Sep 27, 2011 at 10:52:24AM -0700, Damien Bridges wrote:
> Hi All,
>
> Does anyone know how to add bash code to the exec resource? I was
> thinking I could add it to the command section. I thought I could run
> the code after I put the link command and options in. However, it
> didn't work. My bash code has 'if' statements with $ signs in it. I
> want to move block to a directory with its version so it can be sym
> linked to /block.
Personally I've put shell scripting blocks in files (delivered by the puppet
file type), and then have my exec both execute and depend on the existence of
that file.
> move-block () {
> if [[ -s /block/block && ! -h /block ]]; then
> VERSION= /block/block -v | grep -oE
> "[0-9] {1,4}. [0-9] {1,3}. [0-9] {1,4}. [0-9] {1,4}"
> RENAMED_DIR=/block_$VERSION
> echo; echo "Moving System to
> $RENAMED_DIR"
> rm -rf $RENAMED_DIR
> mv /block $RENAMED_DIR
> fi
>
>
> Thanks in advance,
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.