Class: Amnesie::Persist::Systemd
- Inherits:
-
Object
- Object
- Amnesie::Persist::Systemd
- Defined in:
- lib/amnesie/persist/systemd.rb
Instance Method Summary collapse
-
#initialize(card = nil) ⇒ Systemd
constructor
A new instance of Systemd.
- #mac_exist? ⇒ Boolean
- #menu_mac ⇒ Object
- #services ⇒ Object
- #to_s ⇒ Object
- #update_mac ⇒ Object
Constructor Details
Instance Method Details
#mac_exist? ⇒ Boolean
10 11 12 |
# File 'lib/amnesie/persist/systemd.rb', line 10 def mac_exist? File.exist? "#{@systemd_dir}/[email protected]" end |
#menu_mac ⇒ Object
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/amnesie/persist/systemd.rb', line 34 def print "Action on [email protected] for #{@card} (enable/disable) ? (e/d) " answer = gets.chomp case answer when /^e|^E/ mac_enable when /^d|^D/ mac_disable end end |
#services ⇒ Object
18 19 20 21 22 23 |
# File 'lib/amnesie/persist/systemd.rb', line 18 def services mac_service new_service = Helpers::NewSystemd.new(@string, "[email protected]") new_service.add new_service.perm("root", "644") end |
#to_s ⇒ Object
14 15 16 |
# File 'lib/amnesie/persist/systemd.rb', line 14 def to_s @systemd_dir end |
#update_mac ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/amnesie/persist/systemd.rb', line 25 def update_mac print "Found a old [email protected], update? (y|n) " answer = gets.chomp case answer when /^y|^Y/ services end end |