Writing it like this isn't really the "Chef way"

First off, it is better to use not_if { ::Dir.exists? "/usr/local/freeswitch" } - which I think is pretty uncontentious.

Second, to actually get the file and execute should be done using the remote_file resource, and then trigger a notification to actually execute the file. Something like:

    execute "#{Chef::Config[:file_cache_path]}/install.sh" do
      action :nothing
    end
    
    remote_file "#{Chef::Config[:file_cache_path]}/insta(ll.sh" do
      source "https://github.com/plivo/plivoframework/raw/master/freeswitch/install.sh"
      mode "0644"
      not_if { ::Dir.exists? "/usr/local/freeswitch" }
      notifies :run, "execute[#{Chef::Config[:file_cache_path]}/install.sh]", :immediately
    end

Now you could (am I'm pretty sure you will ;)) argue that this is more complex than what you currently have, however I think it is better to use the tools as they were intended.