nfsadmin 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8a4ade82f161c6de715391d95d43c45b0d999135
4
- data.tar.gz: f27866c6cb23523f7492d227a0d497d91a23a335
3
+ metadata.gz: b6c94061c5c00876cf185e93b32e40784c5775ad
4
+ data.tar.gz: 86b2988b4d4aa307c44b82482836a0645297b768
5
5
  SHA512:
6
- metadata.gz: 5dea59632b93fb1df2c210e9ddb6b6fc2a297b2e861e26b601594822b7a378888c57744f3a71533619198c3575c8cfd5bad2594812d76592c5a791ebd7f793a5
7
- data.tar.gz: a959e3f73eff8e24ccb4a55091481b7df2a13e9ffaad0372a4fb3e0e830a4decb7f3c47197117c4771fc9ddd50d7d6c4fa57c9785e39f9f46532fe82fd86cf7a
6
+ metadata.gz: b7431a7c5c7f7dc1ac7251a8bd2be89732a5701111edf85cbc72ac7469f6df2fa8a40665378ba3b84628a42b3c9c0566dabefa9bfd68e07a697ed50f5ae609e9
7
+ data.tar.gz: c77422dc03df9f6d13d0fc7e7b0421999b539ba1bb072387b5cc0621efac9ff97fd0d16188fd8040eb8c9761266a318609d98e0a4673229257e8bd766bc3f3e4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nfsadmin (0.0.3)
4
+ nfsadmin (0.0.4)
5
5
  gli (~> 2.9)
6
6
 
7
7
  GEM
data/bin/nfsadmin CHANGED
@@ -4,10 +4,13 @@ require 'nfsadmin'
4
4
 
5
5
  include GLI::App
6
6
 
7
+ subcommand_option_handling :normal
8
+
7
9
  program_desc 'nfsadmin is a CLI to manage the NFS service and its exports'
8
10
 
9
11
  version Nfsadmin::VERSION
10
12
 
13
+
11
14
  flag [:c,:config], :default_value => '/etc/exports'
12
15
 
13
16
  desc 'The export command manages exported NFS shares'
@@ -42,6 +45,8 @@ command :export do |c|
42
45
 
43
46
  c.desc 'Delete an NFS export from this server'
44
47
  c.command [:rm,:delete] do |delete|
48
+ delete.desc 'The location of the share to delete'
49
+ delete.flag [:l, :location]
45
50
  delete.action do |global_options,options,args|
46
51
  Nfsadmin::Tasks.delete_share(global_options[:c], options[:l])
47
52
  end
@@ -4,6 +4,18 @@ require 'fileutils'
4
4
  module Nfsadmin
5
5
 
6
6
  class Tasks
7
+
8
+ @service_cmd = ''
9
+
10
+ begin
11
+ file = File.new('/usr/sbin/service')
12
+ @service_cmd = '/usr/sbin/service'
13
+ rescue
14
+ file = File.new('/sbin/service')
15
+ @service_cmd = '/sbin/service'
16
+ end
17
+
18
+
7
19
  def self.get_shares(exportsfile)
8
20
  shares = []
9
21
  location = ''
@@ -148,23 +160,23 @@ module Nfsadmin
148
160
  end
149
161
 
150
162
  def self.show_status
151
- `/usr/sbin/service nfs status`
163
+ system "#{@service_cmd} nfs status"
152
164
  end
153
165
 
154
166
  def self.start_service
155
- `/usr/sbin/service nfs start`
167
+ system "#{@service_cmd} nfs start"
156
168
  end
157
169
 
158
170
  def self.stop_service
159
- `/usr/sbin/service nfs stop`
171
+ system "#{@service_cmd} nfs stop"
160
172
  end
161
173
 
162
174
  def self.restart_service
163
- `/usr/sbin/service nfd restart`
175
+ system "#{@service_cmd} nfs restart"
164
176
  end
165
177
 
166
178
  def self.reload_config
167
- `/usr/sbin/service nfs reload`
179
+ system "#{@service_cmd} nfs reload"
168
180
  end
169
181
  end
170
182
 
@@ -1,3 +1,3 @@
1
1
  module Nfsadmin
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nfsadmin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bastiaan Schaap
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-09 00:00:00.000000000 Z
11
+ date: 2014-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake