Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 37 lines (29 sloc) 1.03 KB
#!/home/braeburn/.rvm/bin/ruby
# PLEASE ADAPT THE USER OR PATH IF YOU USE RVM OR NOT
# MAKE SURE THE USER WHICH WILL RUN THE SHELL CAN WRITE IN IT
LOG_FILE="/home/braeburn/repositories/wrapper.log"
$timestamp = Time.now
STDERR.puts "Shellular shell starting, hope it will not break the world!"
begin
require 'pathname'
shell_dir = File.dirname(Pathname(__FILE__).expand_path)
shell = File.join(shell_dir, "realshell.rb")
require shell
# start real things
user_at_host = ARGV[0]
key_bits = ARGV[1]
ssh_command = ENV["SSH_ORIGINAL_COMMAND"]
Shellular::Command.kickstart!(user_at_host, key_bits, ssh_command)
rescue SystemExit => e
exit 1
rescue Exception => e
STDERR.puts "REMOTE: Codular shell: An error occured, please contact administrator."
STDERR.puts "REMOTE: With the following timestamp: '#{$timestamp}'"
a=File.open(LOG_FILE, "a")
a << "ERROR - #{$timestamp} -- #{e.class} - #{e.message}\n"
e.backtrace.each do |bt|
a << "ERROR -\t#{$timestamp} -- #{bt}\n"
end
a << "ERROR - #{$timestamp} -- END\n\n"
a.close
end
Something went wrong with that request. Please try again.