Sureshchandra Jarugula
Sureshchandra Jarugula

Reputation: 123

How can I run bash script file from chef-recipe

I want to implement the logic in chef-recipe like below. How I can achieve this

File=/tmp/productMain.param
if [ -f "${File}" ]; then
 if [ -f /tmp/monitor.sh ]; then
     echo "[INFO] configuration beeing processed"
     /tmp/monitor.sh $File
 else
    error "The monitor script doe not exit
    exit 1
 fi
else
  error "input file does not exist"
  exit 1
fi

Upvotes: 1

Views: 1901

Answers (1)

devopsdina
devopsdina

Reputation: 54

Take a look at the Chef documentation, it is very good and gives examples on how use the bash resource: https://docs.chef.io/resource_bash.html

Upvotes: 1

Related Questions