else
db_shared_buffers=`expr $avail_gb \* 256`
fi
- echo -e "Setting db_shared_buffers to ${db_shared_buffers}GB\c"
+ echo -e "Recommend setting for db_shared_buffers: ${db_shared_buffers}GB"
sed -i -e "s/^ #db_shared_buffers:.*/ db_shared_buffers: \"${db_shared_buffers}GB\"/w $changelog" $config_file
if [ -s $changelog ]
then
- echo " successfully."
+ echo "db_shared_buffers set successfully."
rm $changelog
- else
- echo -e ". . . oops!\n---> db_shared_buffers not found in $config_file."
+ else if grep "^ db_shared_buffers:" $config_file
+ then
+ echo "db_shared_buffers already set. Unchanged."
+ else
+ echo -e ". . . oops!\n---> db_shared_buffers not found in $config_file."
+ fi
fi
# set UNICORN_WORKERS: 2*GB or 2*cores (the same on DO)
unicorn_workers=`expr $avail_cores \* 2`
fi
- echo -e "Setting UNICORN_WORKERS to $unicorn_workers\c"
+ echo -e "Recommended setting UNICORN_WORKERS: $unicorn_workers"
sed -i -e "s/^ #UNICORN_WORKERS:.*/ UNICORN_WORKERS: ${unicorn_workers}/w $changelog" $config_file
if [ -s $changelog ]
then
- echo " successfully."
+ echo "UNICORN_WORKERS set successfully."
rm $changelog
- else
- echo -e ". . . oops!\n---> UNICORN_WORKERS not found in $config_file.\n"
+ else if grep "^ UNICORN_WORKERS:" $config_file
+ then
+ echo "UNICORN_WORKERS already set. Unchanged."
+ else
+ echo -e ". . . oops!\n---> UNICORN_WORKERS not found in $config_file.\n"
+ fi
fi
}