Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- get '/writeDB' do
- targetKey= params[:keyField]
- targetValue = params[:valueField]
- if (targetKey == "selectProfile")
- `cp /var/www/profiles/#{targetValue} /var/www/profile.yml`
- else
- data = YAML.load_file('/var/www/profile.yml')
- data[targetKey] = targetValue
- File.open("/var/www/profiles/current_general_config.yml","w") {|f| YAML.dump(data,f) }
- end
- targetValue
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement