Advertisement
Guest User

Untitled

a guest
Oct 1st, 2014
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. get '/writeDB' do
  2. targetKey= params[:keyField]
  3. targetValue = params[:valueField]
  4. if (targetKey == "selectProfile")
  5. `cp /var/www/profiles/#{targetValue} /var/www/profile.yml`
  6. else
  7. data = YAML.load_file('/var/www/profile.yml')
  8. data[targetKey] = targetValue
  9. File.open("/var/www/profiles/current_general_config.yml","w") {|f| YAML.dump(data,f) }
  10. end
  11. targetValue
  12. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement