Method: Docka::App#setup_sync

Defined in:
lib/docka/app.rb

#setup_syncObject



110
111
112
113
114
115
116
117
118
119
# File 'lib/docka/app.rb', line 110

def setup_sync
  text = ::File.exist?('/etc/exports') ? ::File.read('/etc/exports') : ''
  text.gsub! /# Docka #{uuid}\n.+(\n|$)/, ''
  a = []
  a << text if text.size > 0
  a << "# Docka #{uuid}"
  a << sync_entry
  shell! %( cat | sudo tee /etc/exports ), raise: true, in: "#{a.join("\n")}\n"
  shell! %( sudo nfsd update ), raise: true
end