Skip to content

Commit 6b4ce4f

Browse files
author
root
committed
Fix #267 (Refers to bash interpreter directly)
1 parent 4b7fd8f commit 6b4ce4f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: lib/redmine_gitolite/config.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ def self.gitolite_admin_ssh_script_is_installed?
515515

516516
begin
517517
File.open(gitolite_admin_ssh_script_path, "w") do |f|
518-
f.puts "#!/bin/sh"
518+
f.puts "#!/bin/bash"
519519
f.puts "exec ssh -T -o BatchMode=yes -o StrictHostKeyChecking=no -p #{gitolite_server_port} -i #{gitolite_ssh_private_key} \"$@\""
520520
end
521521

@@ -542,7 +542,7 @@ def self.git_cmd_script_is_installed?
542542

543543
begin
544544
File.open(git_cmd_script_path, "w") do |f|
545-
f.puts '#!/bin/sh'
545+
f.puts '#!/bin/bash'
546546
f.puts "if [ \"\$(whoami)\" = \"#{gitolite_user}\" ] ; then"
547547
f.puts ' cmd=$(printf "\\"%s\\" " "$@")'
548548
f.puts ' cd ~'
@@ -674,7 +674,7 @@ def self.mirroring_keys_installed?(opts = {})
674674

675675
command = 'exec ssh -T -o BatchMode=yes -o StrictHostKeyChecking=no -i ' + "#{git_user_dir}/.ssh/#{GITOLITE_MIRRORING_KEYS_NAME}" + ' "$@"'
676676

677-
RedmineGitolite::GitHosting.execute_command(:shell_cmd, "'cat > #{GITOLITE_MIRRORING_SCRIPT_PATH}'", :pipe_data => "#!/bin/sh", :pipe_command => 'echo')
677+
RedmineGitolite::GitHosting.execute_command(:shell_cmd, "'cat > #{GITOLITE_MIRRORING_SCRIPT_PATH}'", :pipe_data => "#!/bin/bash", :pipe_command => 'echo')
678678
RedmineGitolite::GitHosting.execute_command(:shell_cmd, "'cat >> #{GITOLITE_MIRRORING_SCRIPT_PATH}'", :pipe_data => command, :pipe_command => 'echo')
679679

680680
RedmineGitolite::GitHosting.execute_command(:shell_cmd, "'chmod 700 #{GITOLITE_MIRRORING_SCRIPT_PATH}'")

0 commit comments

Comments
 (0)