lib/vagrant-notify/action/start_server.rb in vagrant-notify-0.5.6 vs lib/vagrant-notify/action/start_server.rb in vagrant-notify-0.6.0
- old
+ new
@@ -18,13 +18,18 @@
provider_name = env[:machine].provider_name
dir = File.expand_path('../../', __FILE__)
return if env[:machine].config.notify.enable == false
- port = next_available_port(env[:notify_data][:bind_ip])
+ bind_ip=env[:notify_data][:bind_ip]
+ port = next_available_port(bind_ip)
+ sender_app = '"' + env[:machine].config.notify.sender_app + '"'
+ sender_params_str = '"' + env[:machine].config.notify.sender_params_str + '"'
+ sender_params_escape = (env[:machine].config.notify.sender_params_escape) ? 1 : 0
+
if which('ruby')
- env[:notify_data][:pid] = Process.spawn("ruby #{dir}/server.rb #{id} #{port} #{env[:notify_data][:bind_ip]} #{provider_name}")
+ env[:notify_data][:pid] = Process.spawn("ruby #{dir}/server.rb #{id} #{port} #{bind_ip} #{sender_app} #{sender_params_str} #{sender_params_escape} #{provider_name}")
env[:notify_data][:port] = port
sleep 5
Process.detach(env[:notify_data][:pid].to_i)
else