bash inline script example in Chef

The bash resource is for including the script contents inline in the recipe code:

bash "inline script" do
  user "root"
  code "mkdir -p /var/www/mysites/ && chown -R www-data /var/www/mysites"
  not_if "[ -d '/var/www/mysites/' ]"
end
or
bash "inline script" do
  user "root"
  code "mkdir -p /var/www/mysites/ && chown -R www-data /var/www/mysites"
  not_if do
    File.directory?('/var/www/mysites')
  end
end