Sha256: e953b013e0066a118e629342222d350ef7e1aea352b2f76338994b6530d91a05

Contents?: true

Size: 426 Bytes

Versions: 123

Compression:

Stored size: 426 Bytes

Contents

#!/usr/bin/env ruby

require 'fileutils'
include FileUtils

dir = ARGV.shift or fail 'require directory to chroot into'
prg = ARGV.shift || '/bin/bash'
system "mount -t proc none #{dir}/proc"
system "mount -o bind /dev #{dir}/dev"
File.exist?(resolv = "#{dir}/etc/resolv.conf") and
  cp resolv, resolv + '.bak'
cp '/etc/resolv.conf', resolv
system "chroot #{dir} #{prg}"
system "umount #{dir}/proc"
system "umount #{dir}/dev"

Version data entries

123 entries across 123 versions & 1 rubygems

Version Path
utils-0.0.67 bin/chroot-exec
utils-0.0.66 bin/chroot-exec
utils-0.0.65 bin/chroot-exec
utils-0.0.64 bin/chroot-exec
utils-0.0.63 bin/chroot-exec
utils-0.0.62 bin/chroot-exec
utils-0.0.61 bin/chroot-exec
utils-0.0.60 bin/chroot-exec
utils-0.0.59 bin/chroot-exec
utils-0.0.58 bin/chroot-exec
utils-0.0.57 bin/chroot-exec
utils-0.0.56 bin/chroot-exec
utils-0.0.55 bin/chroot-exec
utils-0.0.54 bin/chroot-exec
utils-0.0.53 bin/chroot-exec
utils-0.0.52 bin/chroot-exec
utils-0.0.51 bin/chroot-exec
utils-0.0.50 bin/chroot-exec
utils-0.0.49 bin/chroot-exec
utils-0.0.48 bin/chroot-exec