Class: Getch::Config::Account

Inherits:
Object
  • Object
show all
Defined in:
lib/getch/config/account.rb

Instance Method Summary collapse

Constructor Details

#initializeAccount

Returns a new instance of Account.



6
7
8
9
# File 'lib/getch/config/account.rb', line 6

def initialize
  @user = OPTIONS[:username] ||= nil
  @log = Log.new
end

Instance Method Details

#new_userObject



16
17
18
19
20
21
22
23
# File 'lib/getch/config/account.rb', line 16

def new_user
  return unless @user

  create_user
  @log.info "Add a password for #{@user}.\n"
  ChrootOutput.new("passwd #{@user}")
  fix_perm
end

#rootObject



11
12
13
14
# File 'lib/getch/config/account.rb', line 11

def root
  @log.info "Add a password for root.\n"
  ChrootOutput.new('passwd')
end