fix error
This commit is contained in:
parent
c65d0a9ef0
commit
08c2990a53
|
@ -2,14 +2,14 @@ class Admin::BoxController < OrbitAdminController
|
||||||
include ReverseProxy::Controller
|
include ReverseProxy::Controller
|
||||||
SocketFile = "#{Rails.root}/tmp/box.sock"
|
SocketFile = "#{Rails.root}/tmp/box.sock"
|
||||||
Binary = File.expand_path("../../../../bin/box", __FILE__)
|
Binary = File.expand_path("../../../../bin/box", __FILE__)
|
||||||
CSSFile = File.expand_path("../../../../white-on-black.css", __FILE__)
|
CSSFile = File.expand_path("../../../white-on-black.css", __FILE__)
|
||||||
skip_before_filter :verify_authenticity_token
|
skip_before_filter :verify_authenticity_token
|
||||||
|
|
||||||
def index
|
def index
|
||||||
is_not_open = `fuser #{SocketFile}`.gsub(/\n/, '').empty?
|
is_not_open = `fuser #{SocketFile}`.gsub(/\n/, '').empty?
|
||||||
if !File.exists?(SocketFile) || `ss -elx | grep -w "$(stat -c 'ino:%i dev:0/%d' '#{SocketFile}')"`.blank?
|
if !File.exists?(SocketFile) || `ss -elx | grep -w "$(stat -c 'ino:%i dev:0/%d' '#{SocketFile}')"`.blank?
|
||||||
Thread.new do
|
Thread.new do
|
||||||
`#{Binary} --unixdomain-only #{SocketFile}:$USER:$USER:0666 --disable-ssl --css #{CSSFile}`
|
`#{Binary} --unixdomain-only #{SocketFile}:$USER:$USER:0666 --disable-ssl --debug --css #{CSSFile}`
|
||||||
end
|
end
|
||||||
sleep 3
|
sleep 3
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue