diff --git a/app/controllers/admin/i_hebergements_controller.rb b/app/controllers/admin/i_hebergements_controller.rb index 590b985..8319abb 100644 --- a/app/controllers/admin/i_hebergements_controller.rb +++ b/app/controllers/admin/i_hebergements_controller.rb @@ -2,9 +2,18 @@ class Admin::IHebergementsController < ApplicationController layout "admin" - before_filter :auth_admin + before_filter :auth_admin, :except => :restart_support - before_filter :admin_space + before_filter :admin_space, :except => :restart_support + + + def restart_support + r = "nohup sh -c 'sudo systemctl stop quartz_app@support_app && sudo systemctl start quartz_app@support_app && sudo service nginx reload' > /dev/null 2>&1 &" + puts r + puts Bundler.clean_system(r) + + render :inline => "ok" + end def admin_space @admin_space = "sites" diff --git a/config/routes.rb b/config/routes.rb index 7883e45..2e06358 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -112,7 +112,13 @@ Rails.application.routes.draw do namespace :admin do resources :i_tasks - resources :i_hebergements + resources :i_hebergements do + collection do + get :support_app + + end + + end resources :i_websites resources :p_ship_bills resources :p_stats