lxdev 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/lxdev.rb +6 -4
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b44f874a451b8fcbf87c6015993879e1d587f703
4
- data.tar.gz: 31fbead89ddd558dc00126c21d3705ba759a720d
3
+ metadata.gz: 2120a1f663ad212a874571fd8bf7e8a9c786de30
4
+ data.tar.gz: dc6fd44130b3fa99542d48e181222ee4706b80d1
5
5
  SHA512:
6
- metadata.gz: dee6338ab4a878bcd51552da860f80db522ca855160ae774c9d75a85a0f4888947d1ec1af002f8e65b19d94c76d79ded6f60e99789db07a1edaa1ef04279a511
7
- data.tar.gz: abe2b8ff716ae61d65dc9db7f43fac06886fa48b8129c96f015616b8217091234a2bb92b2343dada06f4d018d63236975eb99d43da381f0658d6e264a2e9363d
6
+ metadata.gz: 1b0bfc74622c66e21f19b339ea2d3f6274ae674dfffd28acaa5156634d57097c5ea2b95da84ffab3e2620183498e8cbb844fe89ef9c4a39d702a992907304d6a
7
+ data.tar.gz: 87079f38bd82eecc97c2ca3c40e28639fc4447c6556d87b57b9e619c81efaebb34523315ecf954eba8039e8b4a5b92dbecf470756256006a4927a552a806834c
data/lib/lxdev.rb CHANGED
@@ -6,7 +6,7 @@ class LxDev
6
6
  WHITELISTED_SUDO_COMMANDS = ["lxc", "redir", "kill"]
7
7
  SHELLS = ["bash", "zsh", "sh", "csh", "tcsh", "ash"]
8
8
  BOOT_TIMEOUT = 30
9
- VERSION = '0.1.0'
9
+ VERSION = '0.1.1'
10
10
 
11
11
  def initialize
12
12
  @uid=%x{id -u}.chomp
@@ -105,7 +105,7 @@ class LxDev
105
105
  puts "#{@name} doesn't seem to be running."
106
106
  exit 1
107
107
  end
108
- ssh_command = "ssh -o StrictHostKeyChecking=no -t #{@user}@#{get_container_ip} #{args.empty? ? 'bash --noprofile' : "'#{args.join(' ')}'"}"
108
+ ssh_command = "ssh -o StrictHostKeyChecking=no -t #{@user}@#{get_container_ip} #{args.empty? ? '' : "'#{args.join(' ')}'"}"
109
109
  exec ssh_command
110
110
  end
111
111
 
@@ -189,12 +189,12 @@ class LxDev
189
189
 
190
190
  def add_subuid_and_subgid
191
191
  need_restart = false
192
- %x{sudo grep -q 'root:#{@uid}:1' /etc/subuid}
192
+ %x{grep -q 'root:#{@uid}:1' /etc/subuid}
193
193
  if $?.exitstatus != 0
194
194
  %x{echo 'root:#{@uid}:1' | sudo tee -a /etc/subuid}
195
195
  need_restart = true
196
196
  end
197
- %x{sudo grep -q 'root:#{@gid}:1' /etc/subgid}
197
+ %x{grep -q 'root:#{@gid}:1' /etc/subgid}
198
198
  if $?.exitstatus != 0
199
199
  %x{echo 'root:#{@gid}:1' | sudo tee -a /etc/subgid}
200
200
  need_restart = true
@@ -211,6 +211,8 @@ class LxDev
211
211
  %x{sudo lxc exec #{@name} -- chmod 0700 /home/#{user}/.ssh}
212
212
  %x{ssh-add -L | sudo lxc exec #{@name} tee /home/#{user}/.ssh/authorized_keys}
213
213
  %x{sudo lxc exec #{@name} -- chown -R #{user} /home/#{user}/.ssh}
214
+ %x{sudo lxc exec #{@name} -- touch /home/#{@user}/.hushlogin}
215
+ %x{sudo lxc exec #{@name} -- chown #{user} /home/#{user}/.hushlogin}
214
216
  %x{printf "#{user} ALL=(ALL) NOPASSWD: ALL\n" | sudo lxc exec #{@name} -- tee -a /etc/sudoers}
215
217
  %x{sudo lxc exec #{@name} -- chmod 0440 /etc/sudoers}
216
218
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lxdev
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Lønaas